Skip to content

Commit

Permalink
Merge branch 'dev' into ahmed/sign-on-connect
Browse files Browse the repository at this point in the history
  • Loading branch information
neuodev authored May 3, 2023
2 parents ad0e77d + 6aadbfc commit aa52d30
Show file tree
Hide file tree
Showing 10 changed files with 987 additions and 5,912 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/audit_and_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ jobs:
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v2

- name: Audit dependencies
run:
audit-ci --critical --report-type full --allowlist loader-utils
underscore
run: audit-ci --critical --report-type full

- name: Lockfile lint
run:
lockfile-lint -p yarn.lock --type yarn --allowed-schemes "https:"
"git+https:" --empty-hostname false
lockfile-lint -p yarn.lock --type yarn --allowed-hosts yarn
--validate-https --empty-hostname false

build:
needs: audit
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ COPY package.json ./
COPY yarn.lock ./

FROM base as test

RUN yarn --frozen-lockfile --prefer-offline --no-audit

COPY . .
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@

<p align="center">
<i>Sponsored & used by: </i> <br/> <br/>
<a href="https://github.com/Synthetixio"><img src="./images/synthetix.png" height="100" alt="Synthetix" /></a>
<a href="https://github.com/ethereum-optimism"><img src="./images/optimism-logo.png" height="100" alt="Optimism" /></a>
</p>

<p align="center">
<i>Used by the best:</i> <br/> </br>
<i>Power users:</i> <br/> </br>
<a href="https://github.com/phantom"><img src="./images/phantom.png" height="85" alt="Phantom"/></a>
<a href="https://github.com/ensdomains"><img src="./images/ens.png" height="85" alt="Ethereum Name Service (ENS)" /></a>
<a href="https://github.com/agoraxyz"><img src="./images/guild.png" height="90" alt="Guild" /></a>
<a href="https://github.com/Kwenta"><img src="./images/kwenta.png" height="100" alt="Kwenta" /></a>
<br/>
<a href="https://github.com/ethereum-optimism"><img src="./images/optimism-logo.png" height="100" alt="Optimism" /></a>
<a href="https://github.com/pantherprotocol"><img src="./images/panther.png" height="100" alt="Panther Protocol" /></a>
<a href="https://github.com/Kwenta"><img src="./images/kwenta.png" height="100" alt="Kwenta" /></a>
<a href="https://github.com/Synthetixio"><img src="./images/synthetix.png" height="100" alt="Panther Protocol" /></a>
<a href="https://github.com/agoraxyz"><img src="./images/guild.png" height="90" alt="Guild" /></a>
<br/>
<a href="https://github.com/OffchainLabs"><img src="./images/offchain-labs.png" height="100" alt="Offchain Labs" /></a>
<a href="https://github.com/snapshot-labs"><img src="./images/snapshot-labs.png" height="90" alt="Snapshot Labs" /></a>
Expand All @@ -57,6 +56,15 @@ it directly. Check
[usage examples](https://github.com/Synthetixio/synpress/#usage-examples) for
more details.

## Install

```bash
# with yarn
yarn add -D @synthetixio/synpress
# with npm
npm install --save-dev @synthetixio/synpress
```

## Supported frameworks

- [Synpress](https://github.com/Synthetixio/synpress)
Expand Down
127 changes: 0 additions & 127 deletions commands/synthetix.js

This file was deleted.

23 changes: 0 additions & 23 deletions docs/synpress-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,29 +422,6 @@ setupMetamask(
): Chainable<Subject>;
```

#### `cy.snxExchangerSettle()`

Execute settle on Exchanger contract.

```ts
snxExchangerSettle(
asset: string,
walletAddress: string,
privateKey: string,
): Chainable<Subject>;
```

#### `cy.snxCheckWaitingPeriod()`

Check waiting period on Exchanger contract.

```ts
snxCheckWaitingPeriod(
asset: string,
walletAddress: string,
): Chainable<Subject>;
```

#### `cy.etherscanGetTransactionStatus()`

Get transaction status from Etherscan API.
Expand Down
54 changes: 22 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,67 +49,57 @@
"test:e2e:ci:cypress-action": "SKIP_METAMASK_SETUP=true SYNPRESS_LOCAL_TEST=true CYPRESS_USE_ANVIL=true node synpress.js run --configFile=synpress.config.js"
},
"dependencies": {
"@cypress/code-coverage": "^3.10.0",
"@cypress/webpack-dev-server": "^3.3.0",
"@cypress/code-coverage": "^3.10.4",
"@cypress/webpack-dev-server": "^3.4.1",
"@drptbl/gremlins.js": "^2.2.1",
"@playwright/test": "^1.31.2",
"@synthetixio/js": "^2.41.0",
"@playwright/test": "^1.33.0",
"@testing-library/cypress": "^9.0.0",
"@testing-library/react": "^14.0.0",
"@types/testing-library__cypress": "^5.0.9",
"axios": "^1.3.4",
"axios": "^1.4.0",
"babel-plugin-istanbul": "^6.1.1",
"babel-plugin-react-generate-property": "^1.1.2",
"babel-plugin-react-remove-properties": "^0.3.0",
"babel-plugin-transform-react-qa-classes": "^1.6.0",
"babel-plugin-transform-react-styled-components-qa": "^2.1.0",
"bytes32": "^0.0.3",
"commander": "^10.0.0",
"cypress": "^12.7.0",
"commander": "^10.0.1",
"cypress": "^12.11.0",
"cypress-wait-until": "^1.7.2",
"debug": "^4.3.4",
"dotenv": "^16.0.3",
"dotenv-parse-variables": "^2.0.0",
"download": "^8.0.0",
"ethers": "^6.3.0",
"etherscan-api": "^10.3.0",
"find-config": "^1.0.0",
"node-fetch": "^2.6.1"
},
"devDependencies": {
"@metamask/test-dapp": "^6.1.0",
"@microsoft/eslint-formatter-sarif": "^3.0.0",
"@trunkio/launcher": "^1.2.4",
"npm-check-updates": "^16.10.9",
"release-it": "^15.10.2",
"prettier": "^2.8.8",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.7.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-chai-friendly": "^0.7.2",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-cypress": "^2.13.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-standard": "^4.1.0",
"eslint-plugin-testing-library": "^5.10.2",
"eslint-plugin-testing-library": "^5.10.3",
"eslint-plugin-ui-testing": "^2.0.1",
"eslint-plugin-unicorn": "^46.0.0",
"ethers": "^6.1.0",
"etherscan-api": "^10.3.0",
"find-config": "^1.0.0",
"node-fetch": "^2.6.1",
"prettier": "^2.8.4",
"serve": "^14.2.0",
"start-server-and-test": "^2.0.0",
"synthetix-js": "^2.74.1"
},
"devDependencies": {
"@metamask/test-dapp": "^5.6.0",
"@microsoft/eslint-formatter-sarif": "^3.0.0",
"@trunkio/launcher": "^1.2.3",
"npm-check-updates": "^16.7.12",
"release-it": "^15.8.0"
"start-server-and-test": "^2.0.0"
},
"resolutions": {
"etherscan-api/gh-pages": "5.0.0",
"@synthetixio/js/lodash": "4.17.21",
"@synthetixio/js/**/axios": "1.3.4",
"@synthetixio/js/**/underscore": "1.12.1",
"synthetix-js/**/elliptic": "6.5.4",
"synthetix-js/lodash": "4.17.21",
"synthetix-js/**/axios": "1.3.4",
"synthetix-js/**/json5": "1.0.2",
"synthetix-js/**/node-fetch": "2.6.7",
"download/**/http-cache-semantics": "4.1.1",
"**/ansi-regex": "5.0.1",
"**/@testing-library/dom": "8.20.0"
Expand Down
20 changes: 0 additions & 20 deletions plugins/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const helpers = require('../helpers');
const playwright = require('../commands/playwright');
const metamask = require('../commands/metamask');
const synthetix = require('../commands/synthetix');
const etherscan = require('../commands/etherscan');

/**
Expand Down Expand Up @@ -283,25 +282,6 @@ module.exports = (on, config) => {
});
return true;
},
snxExchangerSettle: async ({ asset, walletAddress, privateKey }) => {
if (process.env.PRIVATE_KEY) {
privateKey = process.env.PRIVATE_KEY;
}
const settled = await synthetix.settle({
asset,
walletAddress,
privateKey,
});
// todo: wait for confirmation?
return settled;
},
snxCheckWaitingPeriod: async ({ asset, walletAddress }) => {
const waitingPeriod = await synthetix.checkWaitingPeriod({
asset,
walletAddress,
});
return waitingPeriod;
},
getNetwork: () => {
const network = helpers.getNetwork();
return network;
Expand Down
27 changes: 2 additions & 25 deletions support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,29 +245,7 @@ Cypress.Commands.add('getNetwork', () => {
return cy.task('getNetwork');
});

// SNX commands

Cypress.Commands.add(
'snxExchangerSettle',
(asset, walletAddress, privateKey) => {
return cy.task(
'snxExchangerSettle',
{ asset, walletAddress, privateKey },
{ timeout: 300000 },
);
},
);

Cypress.Commands.add('snxCheckWaitingPeriod', (asset, walletAddress) => {
return cy.task(
'snxCheckWaitingPeriod',
{ asset, walletAddress },
{ timeout: 200000 },
);
});

// etherscan commands

// Etherscan commands
Cypress.Commands.add('etherscanGetTransactionStatus', txid => {
return cy.task('etherscanGetTransactionStatus', { txid }, { timeout: 30000 });
});
Expand All @@ -276,8 +254,7 @@ Cypress.Commands.add('etherscanWaitForTxSuccess', txid => {
return cy.task('etherscanWaitForTxSuccess', { txid }, { timeout: 120000 });
});

// helper commands

// Helper commands
Cypress.Commands.add('waitForResources', (resources = []) => {
const globalTimeout = 30000;
const resourceCheckInterval = 2000;
Expand Down
Loading

0 comments on commit aa52d30

Please sign in to comment.