From 22240bf94f22c7f9c6f031a319c5eeb64418f777 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 18 Sep 2023 17:50:04 +0300 Subject: [PATCH] Sort imports --- .eslintrc.cjs | 1 - hardhat.config.ts | 3 ++- src/contractFactory.ts | 8 ++++---- src/deploy.ts | 7 ++++--- src/gnosis-safe.ts | 10 +++++----- src/multiSend.ts | 3 ++- src/submitters/auto-submitter.ts | 17 +++++++++-------- src/submitters/eoa-submitter.ts | 5 +++-- .../safe-ima-legacy-marionette-submitter.ts | 5 +++-- .../safe-ima-marionette-submitter.ts | 5 +++-- src/submitters/safe-submitter.ts | 5 +++-- src/submitters/safe-to-ima-submitter.ts | 3 ++- src/submitters/submitter.ts | 3 ++- src/upgrader.ts | 18 +++++++++--------- src/version.ts | 2 +- 15 files changed, 52 insertions(+), 43 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 133f2fb..05fdc8f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -32,7 +32,6 @@ module.exports = { "never" ], - "sort-imports": "warn", "sort-keys": "warn" } }; diff --git a/hardhat.config.ts b/hardhat.config.ts index 9db4014..2bad9de 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,7 +1,8 @@ -import {HardhatUserConfig} from "hardhat/config"; import "@typechain/hardhat"; import "@nomiclabs/hardhat-ethers"; import "@openzeppelin/hardhat-upgrades"; +import {HardhatUserConfig} from "hardhat/config"; + const coreArtifacts = "node_modules/@openzeppelin/upgrades-core/artifacts/[!b]*.json"; diff --git a/src/contractFactory.ts b/src/contractFactory.ts index c7fffbb..90ca4f5 100644 --- a/src/contractFactory.ts +++ b/src/contractFactory.ts @@ -1,13 +1,13 @@ import {artifacts, ethers} from "hardhat"; -import {promises as fs} from "fs"; -import {hashBytecode} from "@openzeppelin/upgrades-core"; -import {LinkReferences} from "hardhat/types"; -import {SkaleManifestData} from "./types/SkaleManifestData"; import { deployLibraries, getLinkedContractFactory, getManifestFile } from "./deploy"; +import {LinkReferences} from "hardhat/types"; +import {SkaleManifestData} from "./types/SkaleManifestData"; +import {promises as fs} from "fs"; +import {hashBytecode} from "@openzeppelin/upgrades-core"; const getSkaleManifest = async () => { diff --git a/src/deploy.ts b/src/deploy.ts index af36a56..21ac93e 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -1,11 +1,12 @@ import {Manifest, hashBytecode} from "@openzeppelin/upgrades-core"; import {artifacts, ethers} from "hardhat"; -import {promises as fs} from "fs"; -import {SkaleManifestData} from "./types/SkaleManifestData"; +import {hexConcat, hexDataSlice} from "ethers/lib/utils"; import {Artifact} from "hardhat/types"; -import {hexDataSlice, hexConcat} from "ethers/lib/utils"; +import {SkaleManifestData} from "./types/SkaleManifestData"; +import {promises as fs} from "fs"; import {getLibrariesNames} from "./contractFactory"; + interface LibraryArtifacts { [key: string]: unknown } diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index ffd43e6..a8d13cd 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -1,14 +1,14 @@ -import chalk from "chalk"; -import {ethers} from "hardhat"; -import {UnsignedTransaction} from "ethers"; -import SafeApiKit from "@safe-global/api-kit"; -import Safe, {EthersAdapter} from "@safe-global/protocol-kit"; import { MetaTransactionData, OperationType, SafeTransaction, SafeTransactionDataPartial } from "@safe-global/safe-core-sdk-types"; +import Safe, {EthersAdapter} from "@safe-global/protocol-kit"; +import SafeApiKit from "@safe-global/api-kit"; +import {UnsignedTransaction} from "ethers"; +import chalk from "chalk"; +import {ethers} from "hardhat"; import {getNetwork} from "@ethersproject/networks"; diff --git a/src/multiSend.ts b/src/multiSend.ts index 54b41ca..9a04e71 100644 --- a/src/multiSend.ts +++ b/src/multiSend.ts @@ -1,4 +1,3 @@ -import {OperationType} from "@safe-global/safe-core-sdk-types"; import {BigNumberish, BytesLike} from "ethers"; import { hexConcat, @@ -7,6 +6,8 @@ import { hexZeroPad, hexlify } from "ethers/lib/utils"; +import {OperationType} from "@safe-global/safe-core-sdk-types"; + interface Transaction { diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index f527875..fb6ff32 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -1,17 +1,18 @@ -import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; -import {Transaction} from "ethers"; -import {ProxyAdmin} from "../../typechain-types"; -import {Submitter} from "./submitter"; import hre, {ethers} from "hardhat"; +import {EXIT_CODES} from "../exitCodes"; import {EoaSubmitter} from "./eoa-submitter"; -import {SafeSubmitter} from "./safe-submitter"; -import chalk from "chalk"; +import {MARIONETTE_ADDRESS} from "./types/marionette"; +import {ProxyAdmin} from "../../typechain-types"; import { SafeImaLegacyMarionetteSubmitter } from "./safe-ima-legacy-marionette-submitter"; -import {MARIONETTE_ADDRESS} from "./types/marionette"; +import {SafeSubmitter} from "./safe-submitter"; +import {Submitter} from "./submitter"; +import {Transaction} from "ethers"; +import chalk from "chalk"; +import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; import {skaleContracts} from "@skalenetwork/skale-contracts-ethers-v5"; -import {EXIT_CODES} from "../exitCodes"; + export class AutoSubmitter extends Submitter { name = "Auto Submitter"; diff --git a/src/submitters/eoa-submitter.ts b/src/submitters/eoa-submitter.ts index bb33216..117d997 100644 --- a/src/submitters/eoa-submitter.ts +++ b/src/submitters/eoa-submitter.ts @@ -1,6 +1,7 @@ -import {ethers} from "hardhat"; -import {UnsignedTransaction} from "ethers"; import {Submitter} from "./submitter"; +import {UnsignedTransaction} from "ethers"; +import {ethers} from "hardhat"; + export class EoaSubmitter extends Submitter { name = "EOA Submitter"; diff --git a/src/submitters/safe-ima-legacy-marionette-submitter.ts b/src/submitters/safe-ima-legacy-marionette-submitter.ts index 07da91f..3cd4758 100644 --- a/src/submitters/safe-ima-legacy-marionette-submitter.ts +++ b/src/submitters/safe-ima-legacy-marionette-submitter.ts @@ -1,7 +1,8 @@ import {BytesLike, UnsignedTransaction} from "ethers"; -import {ethers} from "hardhat"; -import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; import {MARIONETTE_ADDRESS} from "./types/marionette"; +import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; +import {ethers} from "hardhat"; + export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter { marionette = new ethers.Contract( diff --git a/src/submitters/safe-ima-marionette-submitter.ts b/src/submitters/safe-ima-marionette-submitter.ts index 13b70d7..fd076c1 100644 --- a/src/submitters/safe-ima-marionette-submitter.ts +++ b/src/submitters/safe-ima-marionette-submitter.ts @@ -1,7 +1,8 @@ +import {MARIONETTE_ADDRESS, Marionette} from "./types/marionette"; +import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; import {UnsignedTransaction} from "ethers"; import {ethers} from "hardhat"; -import {SafeToImaSubmitter} from "./safe-to-ima-submitter"; -import {MARIONETTE_ADDRESS, Marionette} from "./types/marionette"; + export class SafeImaMarionetteSubmitter extends SafeToImaSubmitter { marionette = new ethers.Contract( diff --git a/src/submitters/safe-submitter.ts b/src/submitters/safe-submitter.ts index 67f41c3..7ecc3d9 100644 --- a/src/submitters/safe-submitter.ts +++ b/src/submitters/safe-submitter.ts @@ -1,7 +1,8 @@ +import {Submitter} from "./submitter"; import {UnsignedTransaction} from "ethers"; -import {ethers} from "hardhat"; import {createMultiSendTransaction} from "../gnosis-safe"; -import {Submitter} from "./submitter"; +import {ethers} from "hardhat"; + export class SafeSubmitter extends Submitter { safeAddress: string; diff --git a/src/submitters/safe-to-ima-submitter.ts b/src/submitters/safe-to-ima-submitter.ts index 33db336..5417f0f 100644 --- a/src/submitters/safe-to-ima-submitter.ts +++ b/src/submitters/safe-to-ima-submitter.ts @@ -1,6 +1,7 @@ import {BytesLike, Contract, UnsignedTransaction} from "ethers"; -import {SafeSubmitter} from "./safe-submitter"; import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; +import {SafeSubmitter} from "./safe-submitter"; + interface Network { targetSchainHash: BytesLike, diff --git a/src/submitters/submitter.ts b/src/submitters/submitter.ts index e5eb10d..25bb29b 100644 --- a/src/submitters/submitter.ts +++ b/src/submitters/submitter.ts @@ -1,6 +1,7 @@ +import {EXIT_CODES} from "../exitCodes"; import {UnsignedTransaction} from "ethers"; import chalk from "chalk"; -import {EXIT_CODES} from "../exitCodes"; + export abstract class Submitter { abstract submit(transactions: UnsignedTransaction[]): Promise; diff --git a/src/upgrader.ts b/src/upgrader.ts index dea962c..083dd7e 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -1,17 +1,17 @@ import hre, {network, upgrades} from "hardhat"; -import chalk from "chalk"; +import {AutoSubmitter} from "./submitters/auto-submitter"; +import {EXIT_CODES} from "./exitCodes"; +import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; import {ProxyAdmin} from "../typechain-types"; -import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; -import {getVersion} from "./version"; -import {promises as fs} from "fs"; +import {Submitter} from "./submitters/submitter"; import {UnsignedTransaction} from "ethers"; +import chalk from "chalk"; +import {promises as fs} from "fs"; +import {getContractFactoryAndUpdateManifest} from "./contractFactory"; import {getImplementationAddress} from "@openzeppelin/upgrades-core"; +import {getManifestAdmin} from "@openzeppelin/hardhat-upgrades/dist/admin"; +import {getVersion} from "./version"; import {verify} from "./verification"; -import {Submitter} from "./submitters/submitter"; -import {AutoSubmitter} from "./submitters/auto-submitter"; -import {Instance} from "@skalenetwork/skale-contracts-ethers-v5"; -import {getContractFactoryAndUpdateManifest} from "./contractFactory"; -import {EXIT_CODES} from "./exitCodes"; interface ContractToUpgrade { diff --git a/src/version.ts b/src/version.ts index cc23402..455a167 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,5 +1,5 @@ -import {exec as asyncExec} from "child_process"; import {existsSync, promises as fs} from "fs"; +import {exec as asyncExec} from "child_process"; import util from "util";