Skip to content

Commit

Permalink
fix: correct project typos (#2456)
Browse files Browse the repository at this point in the history
* fix: correct typos in site docs

* fix: correct comment typos in actions

* fix: correct typos in chain definition property names

* fix: correct typos in zksync action comments

* fix: correct typos in zksync decorator comments

* fix: correct typos in zksync error comments

* fix: correct typos in zksync type comments

* fix: correct typos in zksync util comments

* fix: correct typos in util comments

* fix: correct typos in util bench

* fix: correct transaction type name

* fix: unify autorization spelling variation in tests
  • Loading branch information
ClumsyVlad authored Jun 30, 2024
1 parent 495192c commit 5738943
Show file tree
Hide file tree
Showing 33 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion site/pages/docs/ethers-migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ const data = encodeDeployData({ // [!code hl]
}) // [!code hl]
```

> Note: viem concatinates the contract bytecode onto the ABI encoded data.
> Note: viem concatenates the contract bytecode onto the ABI encoded data.
### Interface.encodeErrorResult

Expand Down
2 changes: 1 addition & 1 deletion site/pages/docs/glossary/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Re-exported from [ABIType](https://abitype.dev/api/types#abifunction).

## `AbiParameter`

`inputs` and `ouputs` item for ABI functions, events, and errors.
`inputs` and `outputs` item for ABI functions, events, and errors.

Re-exported from [ABIType](https://abitype.dev/api/types#abiparameter).

Expand Down
2 changes: 1 addition & 1 deletion site/pages/docs/migration-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ import {
} from 'viem'
```

### Utilties: `isAddress` & `getAddress` perform checksum validation
### Utilities: `isAddress` & `getAddress` perform checksum validation

The `isAddress` utility function now performs checksum validation by default.

Expand Down
2 changes: 1 addition & 1 deletion site/pages/docs/utilities/toFunctionSignature.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Returns the signature for a given function definition.
Returns the signature for a given function definition.

:::tip
This only returns the **functon signature**. If you need the **full human-readable definition**, check out ABIType's [`formatAbiItem`](https://abitype.dev/api/human#formatabiitem-1).
This only returns the **function signature**. If you need the **full human-readable definition**, check out ABIType's [`formatAbiItem`](https://abitype.dev/api/human#formatabiitem-1).
:::

## Install
Expand Down
2 changes: 1 addition & 1 deletion site/pages/experimental/eip5792/sendCalls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const walletClient = createWalletClient({

`string`

The identifier can be any arbitrary string. The only requirement is that for a given session, consumers should be able to call `getCallsStatus` with this identifier to retreive a batch call status and call receipts.
The identifier can be any arbitrary string. The only requirement is that for a given session, consumers should be able to call `getCallsStatus` with this identifier to retrieve a batch call status and call receipts.

## Parameters

Expand Down
2 changes: 1 addition & 1 deletion site/pages/experimental/eip5792/writeContracts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const walletClient = createWalletClient({

`string`

The identifier can be any arbitrary string. The only requirement is that for a given session, consumers should be able to call `getCallsStatus` with this identifier to retreive a batch call status and call receipts.
The identifier can be any arbitrary string. The only requirement is that for a given session, consumers should be able to call `getCallsStatus` with this identifier to retrieve a batch call status and call receipts.

## Parameters

Expand Down
2 changes: 1 addition & 1 deletion site/pages/zksync/actions/estimateGasL1ToL2.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const gas = await walletClient.estimateGasL1ToL2({

- **Type:** `Account | Address`

Address of the paymaster account that will pay the gass. The `paymasterInput` field is required with this one.
Address of the paymaster account that will pay the gas. The `paymasterInput` field is required with this one.

```ts
const gas = await walletClient.estimateGasL1ToL2({
Expand Down
4 changes: 2 additions & 2 deletions src/accounts/utils/signTransaction.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ describe('Sign Transaction (EIP1559)', () => {
})

describe('Sign Transaction (EIP2930)', () => {
bench('viem: `signTransactiion`', async () => {
bench('viem: `signTransaction`', async () => {
await signTransaction({
transaction: { ...base, chainId: 1, gasPrice: 1n, accessList: [] },
privateKey: accounts[0].privateKey,
})
})

bench('ethers: `Wallet.signTransactiion`', async () => {
bench('ethers: `Wallet.signTransaction`', async () => {
await wallet.signTransaction({
...base,
chainId: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/actions/getContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ export type GetContractErrorType = ErrorType
*
* - Docs https://viem.sh/docs/contract/getContract
*
* Using Contract Instances can make it easier to work with contracts if you don't want to pass the `abi` and `address` properites every time you perform contract actions, e.g. [`readContract`](https://viem.sh/docs/contract/readContract), [`writeContract`](https://viem.sh/docs/contract/writeContract), [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas), etc.
* Using Contract Instances can make it easier to work with contracts if you don't want to pass the `abi` and `address` properties every time you perform contract actions, e.g. [`readContract`](https://viem.sh/docs/contract/readContract), [`writeContract`](https://viem.sh/docs/contract/writeContract), [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas), etc.
*
* @example
* import { createPublicClient, getContract, http, parseAbi } from 'viem'
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/watchContractEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export function watchContractEvent<
else for (const log of logs) emit.onLogs([log] as any)
} catch (err) {
// If a filter has been set and gets uninstalled, providers will throw an InvalidInput error.
// Reinitalize the filter when this occurs
// Reinitialize the filter when this occurs
if (filter && err instanceof InvalidInputRpcError)
initialized = false
emit.onError?.(err as Error)
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/watchEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export function watchEvent<
else for (const log of logs) emit.onLogs([log] as any)
} catch (err) {
// If a filter has been set and gets uninstalled, providers will throw an InvalidInput error.
// Reinitalize the filter when this occurs
// Reinitialize the filter when this occurs
if (filter && err instanceof InvalidInputRpcError)
initialized = false
emit.onError?.(err as Error)
Expand Down
2 changes: 1 addition & 1 deletion src/actions/test/getAutomine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { setAutomine } from './setAutomine.js'

const client = anvilMainnet.getClient()

// TODO: Anvil sometimes stops interval mining when automining is programatically set.
// TODO: Anvil sometimes stops interval mining when automining is programmatically set.
test.skip('gets automine status', async () => {
await setAutomine(client, true)
expect(await getAutomine(client)).toEqual(true)
Expand Down
2 changes: 1 addition & 1 deletion src/actions/test/setAutomine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { setAutomine } from './setAutomine.js'

const client = anvilMainnet.getClient()

// TODO: Anvil sometimes stops interval mining when automining is programatically set.
// TODO: Anvil sometimes stops interval mining when automining is programmatically set.
test.skip('sets automine status', async () => {
await expect(setAutomine(client, true)).resolves.toBeUndefined()
expect(await getAutomine(client)).toEqual(true)
Expand Down
2 changes: 1 addition & 1 deletion src/actions/wallet/sendRawTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { TransactionSerializedGeneric } from '../../types/transaction.js'
import type { RequestErrorType } from '../../utils/buildRequest.js'

export type SendRawTransactionParameters = {
/** The signed serialized tranasction. */
/** The signed serialized transaction. */
serializedTransaction: TransactionSerializedGeneric
}

Expand Down
2 changes: 1 addition & 1 deletion src/actions/wallet/signTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export type SignTransactionErrorType =
* - Local Accounts: Signs locally. No JSON-RPC request.
*
* @param args - {@link SignTransactionParameters}
* @returns The signed serialized tranasction. {@link SignTransactionReturnType}
* @returns The signed serialized transaction. {@link SignTransactionReturnType}
*
* @example
* import { createWalletClient, custom } from 'viem'
Expand Down
2 changes: 1 addition & 1 deletion src/chains/definitions/pgn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const pgn = /*#__PURE__*/ defineChain({
url: 'https://explorer.publicgoods.network',
apiUrl: 'https://explorer.publicgoods.network/api',
},
blocksout: {
blockscout: {
name: 'PGN Explorer',
url: 'https://explorer.publicgoods.network',
apiUrl: 'https://explorer.publicgoods.network/api',
Expand Down
2 changes: 1 addition & 1 deletion src/chains/definitions/pgnTestnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const pgnTestnet = /*#__PURE__*/ defineChain({
url: 'https://explorer.sepolia.publicgoods.network',
apiUrl: 'https://explorer.sepolia.publicgoods.network/api',
},
blocksout: {
blockscout: {
name: 'PGN Testnet Explorer',
url: 'https://explorer.sepolia.publicgoods.network',
apiUrl: 'https://explorer.sepolia.publicgoods.network/api',
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ export {
} from './utils/transaction/getSerializedTransactionType.js'
export {
type GetTransactionType,
type GetTransationTypeErrorType,
type GetTransactionTypeErrorType,
getTransactionType,
} from './utils/transaction/getTransactionType.js'
export {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ export {
getSerializedTransactionType,
} from './transaction/getSerializedTransactionType.js'
export {
type GetTransationTypeErrorType,
type GetTransactionTypeErrorType,
type GetTransactionType,
getTransactionType,
} from './transaction/getTransactionType.js'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/signature/hashTypedData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ test('typed message with a domain separator that uses all fields.', () => {
)
})

test('typed message with only custom domain seperator fields', () => {
test('typed message with only custom domain separator fields', () => {
const hash = hashTypedData({
types: {
EIP712Domain: [
Expand Down
2 changes: 1 addition & 1 deletion src/utils/transaction/getTransactionType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export type GetTransactionType<
| (transaction['type'] extends string ? transaction['type'] : never),
> = IsNever<result> extends false ? result : string

export type GetTransationTypeErrorType =
export type GetTransactionTypeErrorType =
| InvalidSerializableTransactionErrorType
| ErrorType

Expand Down
4 changes: 2 additions & 2 deletions src/utils/transaction/serializeTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import {
} from './assertTransaction.js'
import {
type GetTransactionType,
type GetTransationTypeErrorType,
type GetTransactionTypeErrorType,
getTransactionType,
} from './getTransactionType.js'
import {
Expand All @@ -81,7 +81,7 @@ export type SerializeTransactionFn<
>

export type SerializeTransactionErrorType =
| GetTransationTypeErrorType
| GetTransactionTypeErrorType
| SerializeTransactionEIP1559ErrorType
| SerializeTransactionEIP2930ErrorType
| SerializeTransactionEIP4844ErrorType
Expand Down
18 changes: 9 additions & 9 deletions src/utils/typedData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,18 @@ describe('validateTypedData', () => {
],
Person: [
{ name: 'name', type: 'string' },
{ name: 'favouriteNumber', type: 'uint8' },
{ name: 'favoriteNumber', type: 'uint8' },
],
},
primaryType: 'Mail',
message: {
from: {
name: 'Cow',
favouriteNumber: -1,
favoriteNumber: -1,
},
to: {
name: 'Bob',
favouriteNumber: -50,
favoriteNumber: -50,
},
},
}),
Expand All @@ -217,18 +217,18 @@ describe('validateTypedData', () => {
],
Person: [
{ name: 'name', type: 'string' },
{ name: 'favouriteNumber', type: 'uint8' },
{ name: 'favoriteNumber', type: 'uint8' },
],
},
primaryType: 'Mail',
message: {
from: {
name: 'Cow',
favouriteNumber: 256,
favoriteNumber: 256,
},
to: {
name: 'Bob',
favouriteNumber: 0,
favoriteNumber: 0,
},
},
}),
Expand All @@ -250,18 +250,18 @@ describe('validateTypedData', () => {
],
Person: [
{ name: 'name', type: 'string' },
{ name: 'favouriteNumber', type: 'int8' },
{ name: 'favoriteNumber', type: 'int8' },
],
},
primaryType: 'Mail',
message: {
from: {
name: 'Cow',
favouriteNumber: -129,
favoriteNumber: -129,
},
to: {
name: 'Bob',
favouriteNumber: 0,
favoriteNumber: 0,
},
},
}),
Expand Down
6 changes: 3 additions & 3 deletions src/zksync/actions/getL1TokenBalance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ test('provided token is ETH', async () => {
`
[TokenIsEthError: Token is an ETH token.
ETH token cannot be retrived.
ETH token cannot be retrieved.
Version: viem@x.y.z]
`,
Expand All @@ -145,7 +145,7 @@ test('provided token is ETH', async () => {
`
[TokenIsEthError: Token is an ETH token.
ETH token cannot be retrived.
ETH token cannot be retrieved.
Version: viem@x.y.z]
`,
Expand All @@ -161,7 +161,7 @@ test('provided token is ETH', async () => {
`
[TokenIsEthError: Token is an ETH token.
ETH token cannot be retrived.
ETH token cannot be retrieved.
Version: viem@x.y.z]
`,
Expand Down
2 changes: 1 addition & 1 deletion src/zksync/actions/signEip712Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type SignEip712TransactionErrorType = SignTransactionErrorType
* Signs an EIP712 transaction.
*
* @param args - {@link SignTransactionParameters}
* @returns The signed serialized tranasction. {@link SignTransactionReturnType}
* @returns The signed serialized transaction. {@link SignTransactionReturnType}
*
* @example
* import { createWalletClient, custom } from 'viem'
Expand Down
2 changes: 1 addition & 1 deletion src/zksync/actions/signTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export type SignTransactionErrorType = SignTransactionErrorType_
* - Docs: https://viem.sh/docs/zksync/actions/signTransaction
*
* @param args - {@link SignTransactionParameters}
* @returns The signed serialized tranasction. {@link SignTransactionReturnType}
* @returns The signed serialized transaction. {@link SignTransactionReturnType}
*
* @example
* import { createWalletClient, custom } from 'viem'
Expand Down
2 changes: 1 addition & 1 deletion src/zksync/decorators/eip712.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export type Eip712WalletActions<
* - Local Accounts: Signs locally. No JSON-RPC request.
*
* @param args - {@link SignTransactionParameters}
* @returns The signed serialized tranasction. {@link SignTransactionReturnType}
* @returns The signed serialized transaction. {@link SignTransactionReturnType}
*
* @example
* import { createWalletClient, custom } from 'viem'
Expand Down
2 changes: 1 addition & 1 deletion src/zksync/decorators/publicL1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export type PublicActionsL1<
*
* @param client - Client to use
* @param parameters - {@link GetL1TokenBalanceParameters}
* @returns The amount of the ERC20 token the client has on specific addresse. {@link GetL1TokenBalanceReturnType}
* @returns The amount of the ERC20 token the client has on specific address. {@link GetL1TokenBalanceReturnType}
*
* @example
* import { createPublicClient, custom, parseEther } from 'viem'
Expand Down
2 changes: 1 addition & 1 deletion src/zksync/errors/token-is-eth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test('TokenIsEthError', () => {
expect(new TokenIsEthError()).toMatchInlineSnapshot(`
[TokenIsEthError: Token is an ETH token.
ETH token cannot be retrived.
ETH token cannot be retrieved.
Version: viem@x.y.z]
`)
Expand Down
2 changes: 1 addition & 1 deletion src/zksync/errors/token-is-eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class TokenIsEthError extends BaseError {

constructor() {
super(
['Token is an ETH token.', '', 'ETH token cannot be retrived.'].join(
['Token is an ETH token.', '', 'ETH token cannot be retrieved.'].join(
'\n',
),
)
Expand Down
2 changes: 1 addition & 1 deletion src/zksync/types/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type ZkSyncLog<

export type ZkSyncRpcLog = RpcLog_ & {
l1BatchNumber: Hex | null
// These are returned but doesn't apear in Log structure neither is mentioned in https://era.zksync.io/docs/api/js/types
// These are returned but doesn't appear in Log structure neither is mentioned in https://era.zksync.io/docs/api/js/types
transactionLogIndex: Hex
logType: Hex | null
}
Expand Down
2 changes: 1 addition & 1 deletion src/zksync/utils/hashBytecode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('hashed bytecode', async () => {
)
})

test('errors: length must be devisible by 32', async () => {
test('errors: length must be divisible by 32', async () => {
expect(() =>
hashBytecode(invalidBytecodeLengthMustBeDivisibleBy32),
).toThrowErrorMatchingInlineSnapshot(
Expand Down
Loading

0 comments on commit 5738943

Please sign in to comment.