From 864bebb1932ca061f2513e698eaf060ef1e99153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mati=CC=81as?= Date: Mon, 7 Oct 2024 09:40:45 -0300 Subject: [PATCH] fix lint --- packages/builder/src/types.ts | 30 +++++++------- .../src/features/Docs/DocsCannonfilesPage.tsx | 41 ++++++++++++++----- 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/packages/builder/src/types.ts b/packages/builder/src/types.ts index 287a97b84..ee5b1e7c5 100644 --- a/packages/builder/src/types.ts +++ b/packages/builder/src/types.ts @@ -1,22 +1,19 @@ +import _ from 'lodash'; import * as viem from 'viem'; import * as viemUtils from 'viem/utils'; import * as viemNumbers from 'viem/constants/number'; import * as viemAddresses from 'viem/constants/address'; import * as viemBytes from 'viem/constants/bytes'; -import { Abi, Address, Hash, Hex, SendTransactionParameters } from 'viem'; - -import _ from 'lodash'; +import { PackageReference } from './package-reference'; import type { RawChainDefinition } from './actions'; -import { PackageReference } from './package-reference'; - // loosely based on the hardhat `Artifact` type export type ContractArtifact = { contractName: string; sourceName: string; - abi: Abi; - bytecode: Hex; + abi: viem.Abi; + bytecode: viem.Hex; deployedBytecode: string; linkReferences: { [fileName: string]: { @@ -33,8 +30,8 @@ export type ContractArtifact = { }; export type ContractData = { - address: Address; - abi: Abi; + address: viem.Address; + abi: viem.Abi; constructorArgs?: any[]; // only needed for external verification linkedLibraries?: { [sourceName: string]: { [libName: string]: string } }; // only needed for external verification deployTxnHash: string; @@ -54,7 +51,7 @@ export type ContractMap = { export type TransactionMap = { [label: string]: { - hash: Hash | ''; + hash: viem.Hash | ''; blockNumber?: string; timestamp?: string; events: EventMap; @@ -164,14 +161,14 @@ const ethersStyleConstants = { decodeFunctionData: viem.decodeFunctionData, encodeFunctionResult: viem.encodeFunctionResult, decodeFunctionResult: viem.decodeFunctionResult, -} +}; export const CannonHelperContext = { ...viemUtils, ...viemNumbers, ...viemAddresses, ...viemBytes, - ...ethersStyleConstants + ...ethersStyleConstants, }; export type ChainBuilderContextWithHelpers = ChainBuilderContext & typeof CannonHelperContext; @@ -180,7 +177,7 @@ export type BuildOptions = { [val: string]: string }; export type StorageMode = 'all' | 'metadata' | 'none'; -export type CannonSigner = { wallet: viem.WalletClient; address: Address }; +export type CannonSigner = { wallet: viem.WalletClient; address: viem.Address }; export type Contract = Pick; @@ -195,7 +192,10 @@ export interface ChainBuilderRuntimeInfo { getSigner: (addr: viem.Address) => Promise; // returns a signer which should be used for sending the specified transaction. - getDefaultSigner?: (txn: Omit, salt?: string) => Promise; + getDefaultSigner?: ( + txn: Omit, + salt?: string + ) => Promise; // returns contract information from the specified artifact name. getArtifact?: (name: string) => Promise; @@ -313,7 +313,7 @@ export type StepState = { artifacts: ChainArtifacts; // If this is a cannon network build, the full dump of the chain blob is recorded - chainDump?: Hex | null; // only included if cannon network build + chainDump?: viem.Hex | null; // only included if cannon network build }; export type DeploymentState = { [label: string]: StepState }; diff --git a/packages/website/src/features/Docs/DocsCannonfilesPage.tsx b/packages/website/src/features/Docs/DocsCannonfilesPage.tsx index e254ad43d..6df49cc66 100644 --- a/packages/website/src/features/Docs/DocsCannonfilesPage.tsx +++ b/packages/website/src/features/Docs/DocsCannonfilesPage.tsx @@ -326,22 +326,41 @@ export const DocsCannonfilesPage: FC = () => { templates {' '} like - name=<%= settings.name %>). The templates can also use{' '} - + name=<%= settings.name %>). The templates can + also use{' '} + utilities - ,{' '} - + + ,{' '} + number constants - , and{' '} - + + , and{' '} + some {' '} - + others {' '} - from viem. The objects are - also passed into cannonfiles that reference them with the{' '} - pull and clone operations. + from{' '} + + viem + + . The objects are also passed into cannonfiles that reference + them with the pull and clone{' '} + operations. Packages that result from builds consist of three @@ -801,4 +820,4 @@ export const DocsCannonfilesPage: FC = () => { ); -}; \ No newline at end of file +};