Skip to content

Commit

Permalink
Fix issues with testing-kit executable
Browse files Browse the repository at this point in the history
  • Loading branch information
yagopv committed Sep 19, 2024
1 parent 526a718 commit 0841d7d
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 48 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/api-kit-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ jobs:
- name: Build
run: yarn build

- name: Make testing-kit.js executable
run: chmod +x packages/testing-kit/dist/bin/testing-kit.js

- name: Add script directory to PATH
run: echo "$(pwd)/packages/testing-kit/dist/bin" >> $GITHUB_PATH

- name: Test
run: |
cd packages/api-kit
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/protocol-kit-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ jobs:
- run: |
yarn install --frozen-lockfile
yarn build
- name: Make testing-kit.js executable
run: chmod +x packages/testing-kit/dist/bin/testing-kit.js
- name: Add script directory to PATH
run: echo "$(pwd)/packages/testing-kit/dist/bin" >> $GITHUB_PATH
- name: Test ${{ matrix.provider }} - Safe ${{ matrix.contract-version }}
run: |
cd packages/protocol-kit
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/sdk-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ jobs:
- name: Build
run: yarn build

- name: Make testing-kit.js executable
run: chmod +x packages/testing-kit/dist/bin/testing-kit.js

- name: Add script directory to PATH
run: echo "$(pwd)/packages/testing-kit/dist/bin" >> $GITHUB_PATH

- name: Test
env:
PRIVATE_KEY: ${{ secrets.TESTING_PRIVATE_KEY }}
Expand Down
14 changes: 7 additions & 7 deletions packages/api-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"API"
],
"scripts": {
"test:web3": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=web3 && nyc --reporter=lcov testing-kit.js test 'tests/endpoint/*.test.*'",
"test:ethers": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=ethers && nyc --reporter=lcov testing-kit.js test 'tests/endpoint/*.test.*'",
"test:viem": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=viem && nyc --reporter=lcov testing-kit.js test 'tests/endpoint/*.test.*'",
"test:web3": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=web3 && nyc --reporter=lcov testing-kit test 'tests/endpoint/*.test.*'",
"test:ethers": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=ethers && nyc --reporter=lcov testing-kit test 'tests/endpoint/*.test.*'",
"test:viem": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=viem && nyc --reporter=lcov testing-kit test 'tests/endpoint/*.test.*'",
"test": "yarn test:viem",
"test:ci:web3": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=web3 && nyc --reporter=lcov testing-kit.js test 'tests/e2e/*.test.*'",
"test:ci:ethers": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=ethers && nyc --reporter=lcov testing-kit.js test 'tests/e2e/*.test.*'",
"test:ci:viem": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=viem && nyc --reporter=lcov testing-kit.js test 'tests/e2e/*.test.*'",
"test:ci:web3": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=web3 && nyc --reporter=lcov testing-kit test 'tests/e2e/*.test.*'",
"test:ci:ethers": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=ethers && nyc --reporter=lcov testing-kit test 'tests/e2e/*.test.*'",
"test:ci:viem": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=viem && nyc --reporter=lcov testing-kit test 'tests/e2e/*.test.*'",
"test:ci": "yarn test:ci:viem",
"format:check": "prettier --check \"*/**/*.{js,json,md,ts}\"",
"format": "prettier --write \"*/**/*.{js,json,md,ts}\"",
Expand All @@ -40,7 +40,7 @@
"homepage": "https://github.com/safe-global/safe-core-sdk#readme",
"devDependencies": {
"@safe-global/relay-kit": "^3.1.0",
"@safe-global/testing-kit": "^0.0.1-alpha.0",
"@safe-global/testing-kit": "^0.0.1-alpha.1",
"@types/chai": "^4.3.19",
"@types/chai-as-promised": "^7.1.8",
"@types/mocha": "^10.0.8",
Expand Down
32 changes: 16 additions & 16 deletions packages/protocol-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
"update-safe-deployments": "ts-node scripts/safe-deployments/updateLocalNetworks.ts",
"check-short-name-integrity": "ts-node scripts/safe-deployments/checkShortNameIntegrity.ts",
"test": "mocha -r ts-node/register -r tsconfig-paths/register tests/unit/**/*.ts",
"test:hardhat:web3:v1.0.0": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.0.0 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:web3:v1.1.1": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.1.1 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:web3:v1.2.0": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.2.0 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:web3:v1.3.0": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.3.0 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:web3:v1.4.1": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.4.1 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:ethers:v1.0.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.0.0 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:ethers:v1.1.1": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.1.1 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:ethers:v1.2.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.2.0 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:ethers:v1.3.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.3.0 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:ethers:v1.4.1": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.4.1 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:viem:v1.0.0": "export TEST_NETWORK=hardhat && export ETH_LIB=viem && export SAFE_VERSION=1.0.0 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:viem:v1.1.1": "export TEST_NETWORK=hardhat && export ETH_LIB=viem && export SAFE_VERSION=1.1.1 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:viem:v1.2.0": "export TEST_NETWORK=hardhat && export ETH_LIB=viem && export SAFE_VERSION=1.2.0 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:viem:v1.3.0": "export TEST_NETWORK=hardhat && export ETH_LIB=viem && export SAFE_VERSION=1.3.0 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:viem:v1.4.1": "export TEST_NETWORK=hardhat && export ETH_LIB=viem && export SAFE_VERSION=1.4.1 && testing-kit.js deploy && nyc testing-kit.js test 'tests/e2e/*.test.*'",
"test:hardhat:web3:v1.0.0": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.0.0 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:web3:v1.1.1": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.1.1 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:web3:v1.2.0": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.2.0 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:web3:v1.3.0": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.3.0 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:web3:v1.4.1": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.4.1 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:ethers:v1.0.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.0.0 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:ethers:v1.1.1": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.1.1 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:ethers:v1.2.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.2.0 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:ethers:v1.3.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.3.0 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:ethers:v1.4.1": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.4.1 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:viem:v1.0.0": "export TEST_NETWORK=hardhat && export ETH_LIB=viem && export SAFE_VERSION=1.0.0 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:viem:v1.1.1": "export TEST_NETWORK=hardhat && export ETH_LIB=viem && export SAFE_VERSION=1.1.1 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:viem:v1.2.0": "export TEST_NETWORK=hardhat && export ETH_LIB=viem && export SAFE_VERSION=1.2.0 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:viem:v1.3.0": "export TEST_NETWORK=hardhat && export ETH_LIB=viem && export SAFE_VERSION=1.3.0 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"test:hardhat:viem:v1.4.1": "export TEST_NETWORK=hardhat && export ETH_LIB=viem && export SAFE_VERSION=1.4.1 && testing-kit deploy && nyc testing-kit test 'tests/e2e/*.test.*'",
"coverage": "nyc report --reporter=lcov",
"format:check": "prettier --check \"*/**/*.{js,json,md,ts}\"",
"format": "prettier --write \"*/**/*.{js,json,md,ts}\"",
Expand All @@ -52,7 +52,7 @@
"homepage": "https://github.com/safe-global/safe-core-sdk#readme",
"devDependencies": {
"@safe-global/safe-passkey": "0.2.0-alpha.1",
"@safe-global/testing-kit": "^0.0.1-alpha.0",
"@safe-global/testing-kit": "^0.0.1-alpha.1",
"@types/chai": "^4.3.19",
"@types/chai-as-promised": "^7.1.8",
"@types/mocha": "^10.0.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol-kit/src/utils/eip-712/encode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EIP712TypedData, TypedDataTypes, TypedMessageTypes } from 'packages/types-kit/dist/src'
import { EIP712TypedData, TypedDataTypes, TypedMessageTypes } from '@safe-global/types-kit'
import {
keccak256,
concat,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env node
/* eslint-disable @typescript-eslint/no-var-requires */

import { execSync } from 'child_process'
import path from 'path'
import fs from 'fs'
const { execSync } = require('child_process')
const path = require('path')
const fs = require('fs')

// Resolve the root directory of the package
const packageRoot = path.resolve(__dirname, '../../')
const packageRoot = path.resolve(__dirname, '../')
const projectRoot = process.cwd()

// Capture the command and arguments
Expand Down Expand Up @@ -42,6 +43,6 @@ try {
execSync(`yarn ${command}`, { stdio: 'inherit' })
}
} catch (error) {
console.error(`Failed to execute Hardhat command: ${(error as Error).message}`)
console.error(`Failed to execute Hardhat command: ${error.message}`)
process.exit(1)
}
6 changes: 3 additions & 3 deletions packages/testing-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@safe-global/testing-kit",
"version": "0.0.1-alpha.0",
"version": "0.0.1-alpha.1",
"description": "Helper package providing testing utilities",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand All @@ -16,7 +16,7 @@
"format:check": "prettier --check \"*/**/*.{js,json,md,ts}\"",
"format": "prettier --write \"*/**/*.{js,json,md,ts}\"",
"unbuild": "rimraf dist artifacts deployments cache .nyc_output *.tsbuildinfo",
"build": "yarn unbuild && hardhat compile && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && chmod +x dist/bin/testing-kit.js",
"build": "yarn unbuild && hardhat compile && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && chmod +x ./bin/testing-kit.js",
"deploy": "hardhat deploy",
"compile": "hardhat compile",
"test": "hardhat test"
Expand Down Expand Up @@ -49,7 +49,7 @@
"semver": "^7.6.3"
},
"bin": {
"testing-kit": "./dist/bin/testing-kit.js"
"testing-kit": "./bin/testing-kit.js"
},
"peerDependencies": {
"hardhat": "^2.19.3"
Expand Down

0 comments on commit 0841d7d

Please sign in to comment.