Skip to content

Commit

Permalink
fix: matic to pol upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
grothem committed Sep 26, 2024
1 parent 94b72b0 commit 3218d2a
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,48 @@ const tokensToRequest: RequestedTokens = {
const testData = {
testCases: {
deposit: {
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
amount: 1.09,
hasApproval: true,
},
collateral: {
switchOff: {
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
isCollateralType: true,
hasApproval: true,
},
switchOn: {
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
isCollateralType: false,
hasApproval: true,
},
switchNegative: {
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
isCollateralType: true,
},
},
borrow: {
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
amount: 0.04,
apyType: constants.borrowAPYType.default,
hasApproval: false,
},
repay: {
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
apyType: constants.apyType.variable,
amount: 0.01,
hasApproval: true,
repayOption: constants.repayType.default,
},
withdraw: [
{
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
isCollateral: true,
amount: 0.01,
hasApproval: false,
},
{
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
isCollateral: true,
amount: 0.01,
hasApproval: true,
Expand All @@ -76,24 +76,24 @@ const testData = {
finalDashboard: [
{
type: constants.dashboardTypes.deposit,
assetName: assets.polygonMarket.MATIC.shortName,
wrapped: assets.polygonMarket.MATIC.wrapped,
assetName: assets.polygonMarket.POL.shortName,
wrapped: assets.polygonMarket.POL.wrapped,
amount: 1.07,
collateralType: constants.collateralType.isCollateral,
isCollateral: true,
},
{
type: constants.dashboardTypes.borrow,
assetName: assets.polygonMarket.MATIC.shortName,
wrapped: assets.polygonMarket.MATIC.wrapped,
assetName: assets.polygonMarket.POL.shortName,
wrapped: assets.polygonMarket.POL.wrapped,
amount: 0.03,
apyType: constants.borrowAPYType.variable,
},
],
},
};

describe('MATIC INTEGRATION SPEC, POLYGON V2 MARKET', () => {
describe('POL INTEGRATION SPEC, POLYGON V2 MARKET', () => {
const skipTestState = skipState(false);
configEnvWithTenderlyPolygonFork({ tokens: tokenSet(tokensToRequest) });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const tokensToRequest: RequestedTokens = {

const testData = {
depositBaseAmount: {
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
amount: 800,
hasApproval: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ const tokensToRequest: RequestedTokens = {
const testData = {
testCases: {
borrow: {
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
amount: 1,
apyType: constants.borrowAPYType.default,
hasApproval: false,
isRisk: true,
},
deposit2: {
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
amount: 1,
hasApproval: true,
},
withdraw: {
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
isCollateral: true,
amount: 9999,
hasApproval: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { dashboardAssetValuesVerification } from '../../../support/steps/verific
const testData = {
v2Market: {
depositBase: {
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
amount: 500,
hasApproval: true,
},
Expand All @@ -20,7 +20,7 @@ const testData = {
hasApproval: true,
},
{
asset: assets.polygonMarket.MATIC,
asset: assets.polygonMarket.POL,
amount: 100,
apyType: constants.borrowAPYType.default,
hasApproval: false,
Expand All @@ -43,11 +43,11 @@ const testData = {
},
migration: {
supplies: [
{ shortName: assets.polygonMarket.MATIC.shortName },
{ shortName: assets.polygonMarket.POL.shortName },
{ shortName: assets.polygonMarket.DAI.shortName },
],
borrows: [
{ shortName: assets.polygonMarket.MATIC.shortName },
{ shortName: assets.polygonMarket.POL.shortName },
{ shortName: assets.polygonMarket.DAI.shortName },
],
isAllSupplies: true,
Expand All @@ -57,8 +57,8 @@ const testData = {
finalDashboard1: [
{
type: constants.dashboardTypes.deposit,
assetName: assets.polygonMarket.MATIC.shortName,
wrapped: assets.polygonMarket.MATIC.wrapped,
assetName: assets.polygonMarket.POL.shortName,
wrapped: assets.polygonMarket.POL.wrapped,
amount: 500,
collateralType: constants.collateralType.isCollateral,
isCollateral: true,
Expand All @@ -80,8 +80,8 @@ const testData = {
},
{
type: constants.dashboardTypes.borrow,
assetName: assets.polygonMarket.MATIC.shortName,
wrapped: assets.polygonMarket.MATIC.wrapped,
assetName: assets.polygonMarket.POL.shortName,
wrapped: assets.polygonMarket.POL.wrapped,
amount: 100,
apyType: constants.borrowAPYType.variable,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const tokensToRequest: RequestedTokens = {
const testData = {
swap: [
{
fromAsset: assets.polygonMarket.MATIC,
fromAsset: assets.polygonMarket.POL,
toAsset: assets.polygonMarket.USDC,
isCollateralFromAsset: true,
amount: 10,
Expand All @@ -31,7 +31,7 @@ const testData = {
},
{
type: constants.dashboardTypes.deposit,
assetName: assets.polygonMarket.MATIC.shortName,
assetName: assets.polygonMarket.POL.shortName,
amount: 90,
collateralType: constants.collateralType.isCollateral,
isCollateral: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,43 @@ import {
const testData = {
testCases: {
deposit: {
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
amount: 1.09,
hasApproval: true,
},
collateral: {
switchOff: {
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
isCollateralType: true,
hasApproval: true,
},
switchOn: {
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
isCollateralType: false,
hasApproval: true,
},
switchNegative: {
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
isCollateralType: true,
},
},
borrow: [
{
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
amount: 0.06,
apyType: constants.borrowAPYType.default,
hasApproval: false,
},
],
withdraw: [
{
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
isCollateral: true,
amount: 0.01,
hasApproval: false,
},
{
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
isCollateral: true,
amount: 0.01,
hasApproval: true,
Expand All @@ -63,22 +63,22 @@ const testData = {
],
repay: [
{
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
apyType: constants.apyType.variable,
amount: 0.01,
hasApproval: true,
repayOption: constants.repayType.default,
},
{
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
apyType: constants.apyType.variable,
repayableAsset: assets.polygonV3Market.WMATIC,
repayableAsset: assets.polygonV3Market.WPOL,
amount: 0.01,
hasApproval: false,
repayOption: constants.repayType.default,
},
{
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
apyType: constants.apyType.variable,
repayableAsset: assets.polygonV3Market.aWMATIC,
amount: 0.01,
Expand All @@ -91,14 +91,14 @@ const testData = {
finalDashboard: [
{
type: constants.dashboardTypes.deposit,
assetName: assets.polygonV3Market.MATIC.shortName,
assetName: assets.polygonV3Market.POL.shortName,
amount: 1.06,
collateralType: constants.collateralType.isCollateral,
isCollateral: true,
},
{
type: constants.dashboardTypes.borrow,
assetName: assets.polygonV3Market.MATIC.shortName,
assetName: assets.polygonV3Market.POL.shortName,
amount: 0.03,
apyType: constants.borrowAPYType.variable,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ const tokensToRequest: RequestedTokens = {
const testData = {
testCases: {
borrow: {
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
amount: 1,
apyType: constants.borrowAPYType.default,
hasApproval: false,
isRisk: true,
},
deposit2: {
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
amount: 1,
hasApproval: true,
},
withdraw: {
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
isCollateral: true,
amount: 9999,
hasApproval: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const tokensToRequest: RequestedTokens = {
const testData = {
testCases: {
deposit1: {
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
amount: 100,
hasApproval: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const tokensToRequest: RequestedTokens = {
const testData = {
testCases: {
swapMATIC: {
fromAsset: assets.polygonV3Market.MATIC,
fromAsset: assets.polygonV3Market.POL,
toAsset: assets.polygonV3Market.USDT,
isCollateralFromAsset: true,
amount: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ const tokensToRequest: RequestedTokens = {
const testData = {
testCases: {
depositMATIC: {
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
amount: 100,
hasApproval: true,
},
swapMATIC: {
fromAsset: assets.polygonV3Market.MATIC,
fromAsset: assets.polygonV3Market.POL,
toAsset: assets.polygonV3Market.USDT,
isCollateralFromAsset: true,
amount: 10,
Expand Down Expand Up @@ -60,7 +60,7 @@ const testData = {
hasApproval: true,
},
switchCollateralForMATIC: {
asset: assets.polygonV3Market.MATIC,
asset: assets.polygonV3Market.POL,
isCollateralType: true,
hasApproval: true,
},
Expand Down
24 changes: 12 additions & 12 deletions cypress/fixtures/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
}
},
"polygonMarket": {
"MATIC": {
"fullName": "Matic",
"shortName": "MATIC",
"POL": {
"fullName": "POL",
"shortName": "POL",
"wrapped": true
},
"WMATIC": {
"fullName": "Wrapped Matic",
"shortName": "WMATIC",
"WPOL": {
"fullName": "Wrapped POL",
"shortName": "WPOL",
"wrapped": true
},
"amWMATIC": {
Expand Down Expand Up @@ -611,14 +611,14 @@
}
},
"polygonV3Market": {
"MATIC": {
"fullName": "MATIC",
"shortName": "MATIC",
"POL": {
"fullName": "POL",
"shortName": "POL",
"wrapped": true
},
"WMATIC": {
"fullName": "WMATIC",
"shortName": "WMATIC",
"WPOL": {
"fullName": "WPOL",
"shortName": "WPOL",
"wrapped": true
},
"aWMATIC": {
Expand Down
Loading

0 comments on commit 3218d2a

Please sign in to comment.