From a7924739d963b04f2d5d172623bd7e0528053b94 Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Nov 2023 13:18:06 -0800 Subject: [PATCH] wip: Add ua-utils-test-v2 package --- packages/ua-utils-test-v2/.eslintignore | 2 + packages/ua-utils-test-v2/.gitignore | 1 + packages/ua-utils-test-v2/.prettierignore | 2 + packages/ua-utils-test-v2/README.md | 27 +++++++++++++ packages/ua-utils-test-v2/hardhat.config.ts | 22 ++++++++++ packages/ua-utils-test-v2/package.json | 40 +++++++++++++++++++ packages/ua-utils-test-v2/test/config.test.ts | 8 ++++ packages/ua-utils-test-v2/tsconfig.json | 9 +++++ packages/ua-utils/package.json | 2 - yarn.lock | 10 +++-- 10 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 packages/ua-utils-test-v2/.eslintignore create mode 100644 packages/ua-utils-test-v2/.gitignore create mode 100644 packages/ua-utils-test-v2/.prettierignore create mode 100644 packages/ua-utils-test-v2/README.md create mode 100644 packages/ua-utils-test-v2/hardhat.config.ts create mode 100644 packages/ua-utils-test-v2/package.json create mode 100644 packages/ua-utils-test-v2/test/config.test.ts create mode 100644 packages/ua-utils-test-v2/tsconfig.json diff --git a/packages/ua-utils-test-v2/.eslintignore b/packages/ua-utils-test-v2/.eslintignore new file mode 100644 index 000000000..db4c6d9b6 --- /dev/null +++ b/packages/ua-utils-test-v2/.eslintignore @@ -0,0 +1,2 @@ +dist +node_modules \ No newline at end of file diff --git a/packages/ua-utils-test-v2/.gitignore b/packages/ua-utils-test-v2/.gitignore new file mode 100644 index 000000000..5e4659675 --- /dev/null +++ b/packages/ua-utils-test-v2/.gitignore @@ -0,0 +1 @@ +cache \ No newline at end of file diff --git a/packages/ua-utils-test-v2/.prettierignore b/packages/ua-utils-test-v2/.prettierignore new file mode 100644 index 000000000..763301fc0 --- /dev/null +++ b/packages/ua-utils-test-v2/.prettierignore @@ -0,0 +1,2 @@ +dist/ +node_modules/ \ No newline at end of file diff --git a/packages/ua-utils-test-v2/README.md b/packages/ua-utils-test-v2/README.md new file mode 100644 index 000000000..dea8a59d6 --- /dev/null +++ b/packages/ua-utils-test-v2/README.md @@ -0,0 +1,27 @@ +

+ + LayerZero + +

+ +

@layerzerolabs/hardhat-utils

+ + +

+ + NPM Version + + Downloads + + NPM License +

+ +## Installation + +```bash +yarn add @layerzerolabs/hardhat-utils + +pnpm add @layerzerolabs/hardhat-utils + +npm install @layerzerolabs/hardhat-utils +``` diff --git a/packages/ua-utils-test-v2/hardhat.config.ts b/packages/ua-utils-test-v2/hardhat.config.ts new file mode 100644 index 000000000..ece417c3a --- /dev/null +++ b/packages/ua-utils-test-v2/hardhat.config.ts @@ -0,0 +1,22 @@ +import { withLayerZeroArtifacts } from "@layerzerolabs/hardhat-utils" +import { HardhatUserConfig } from "hardhat/types" + +/** + * This is a dummy hardhat config that enables us to test + * hardhat functionality without mocking too much + */ +const config: HardhatUserConfig = { + networks: { + "ethereum-mainnet": { + url: "https://eth.llamarpc.com", + }, + "bsc-testnet": { + url: "https://bsc-testnet.publicnode.com", + accounts: { + mnemonic: "test test test test test test test test test test test junk", + }, + }, + }, +} + +export default withLayerZeroArtifacts("@layerzerolabs/lz-evm-sdk-v2")(config) diff --git a/packages/ua-utils-test-v2/package.json b/packages/ua-utils-test-v2/package.json new file mode 100644 index 000000000..a1b28d910 --- /dev/null +++ b/packages/ua-utils-test-v2/package.json @@ -0,0 +1,40 @@ +{ + "name": "@layerzerolabs/ua-utils-test-v2", + "description": "Integration tests for ua-utils for V2", + "version": "0.0.1", + "license": "MIT", + "private": true, + "scripts": { + "lint": "npx eslint '**/*.{js,ts,json}'", + "test": "npx hardhat test" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/LayerZero-Labs/lz-utils.git", + "directory": "packages/ua-utils-test" + }, + "devDependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/providers": "^5.7.0", + "@ethersproject/wallet": "^5.7.0", + "@gnosis.pm/safe-core-sdk": "^2.0.0", + "@gnosis.pm/safe-core-sdk-types": "^1.0.0", + "@gnosis.pm/safe-ethers-lib": "^1.0.0", + "@gnosis.pm/safe-service-client": "1.1.1", + "@layerzerolabs/hardhat-utils": "~0.0.1", + "@layerzerolabs/lz-definitions": "~1.5.58", + "@layerzerolabs/lz-evm-sdk-v1": "~1.5.58", + "@layerzerolabs/lz-evm-sdk-v2": "~1.5.58", + "@layerzerolabs/ua-utils": "~0.0.15", + "@types/chai-as-promised": "^7.1.7", + "@nomiclabs/hardhat-ethers": "^2.2.3", + "ethers": "^5.7.0", + "chai": "^4.3.10", + "chai-as-promised": "^7.1.1", + "hardhat": "^2.9.9", + "hardhat-deploy": "^0.11.22", + "sinon": "^17.0.1", + "ts-node": "^10.9.1", + "typescript": "^5.2.2" + } +} diff --git a/packages/ua-utils-test-v2/test/config.test.ts b/packages/ua-utils-test-v2/test/config.test.ts new file mode 100644 index 000000000..b165defaa --- /dev/null +++ b/packages/ua-utils-test-v2/test/config.test.ts @@ -0,0 +1,8 @@ +import { expect } from "chai" +import { describe } from "mocha" + +describe("config", () => { + it("should always fail", () => { + expect(1).to.equal(0) + }) +}) diff --git a/packages/ua-utils-test-v2/tsconfig.json b/packages/ua-utils-test-v2/tsconfig.json new file mode 100644 index 000000000..084db5958 --- /dev/null +++ b/packages/ua-utils-test-v2/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "exclude": ["dist", "node_modules"], + "include": ["src", "test", "*.config.ts"], + "compilerOptions": { + "module": "commonjs", + "types": ["node", "mocha"] + } +} diff --git a/packages/ua-utils/package.json b/packages/ua-utils/package.json index f22d077cc..5d971bd92 100644 --- a/packages/ua-utils/package.json +++ b/packages/ua-utils/package.json @@ -27,7 +27,6 @@ "@gnosis.pm/safe-ethers-lib": "^1.0.0", "@gnosis.pm/safe-service-client": "1.1.1", "@layerzerolabs/lz-definitions": "~1.5.58", - "@layerzerolabs/lz-sdk": "0.0.12", "@nomiclabs/hardhat-ethers": "^2.2.3", "@types/mocha": "^10.0.1", "cli-ux": "^6.0.9", @@ -45,7 +44,6 @@ "@gnosis.pm/safe-ethers-lib": "^1.0.0", "@gnosis.pm/safe-service-client": "1.1.1", "@layerzerolabs/lz-definitions": "~1.5.58", - "@layerzerolabs/lz-sdk": "0.0.12", "@nomiclabs/hardhat-ethers": "^2.2.3", "ethers": "^5.5.2", "hardhat": "~2.12.5", diff --git a/yarn.lock b/yarn.lock index 48391086f..162688426 100644 --- a/yarn.lock +++ b/yarn.lock @@ -934,10 +934,12 @@ "@ethersproject/providers" "^5.7.2" ethers "^5.7.2" -"@layerzerolabs/lz-sdk@0.0.12": - version "0.0.12" - resolved "https://registry.npmjs.org/@layerzerolabs/lz-sdk/-/lz-sdk-0.0.12.tgz" - integrity sha512-ldf+H8SVUF9EtaQg9y7XzGDP95lH4T/UIYVglL2DrNBe5CBiWm5wkL/5SnGpTgbLHbw60eLaGxQH/wmO6txAiQ== +"@layerzerolabs/lz-evm-sdk-v2@~1.5.58": + version "1.5.60" + resolved "https://registry.yarnpkg.com/@layerzerolabs/lz-evm-sdk-v2/-/lz-evm-sdk-v2-1.5.60.tgz#d4905887e8475971ace4e191fff879a2cf2da0d2" + integrity sha512-Bt60PTdw/rNdZxNGF0xnk1JiIxy5k2kQCzPEe/ebyz9ZEDpaFEkOnwZi2yKQgyHuxOUfwOmRo0NUFfReyk8ioA== + dependencies: + ethers "^5.7.2" "@manypkg/find-root@^1.1.0": version "1.1.0"