Skip to content

Commit

Permalink
fix: txpool casing
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Feb 27, 2023
1 parent 2350d1a commit 057e01e
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 26 deletions.
6 changes: 6 additions & 0 deletions .changeset/breezy-ligers-press.md
@@ -0,0 +1,6 @@
---
"viem": patch
---

- `testClient.getTxPoolContent``testClient.getTxpoolContent`
- `testClient.getTxPoolStatus``testClient.getTxpoolStatus`
4 changes: 2 additions & 2 deletions site/docs/actions/test/sendUnsignedTransaction.md
Expand Up @@ -21,12 +21,12 @@ Executes a transaction regardless of the signature.
```ts
import { testClient } from '.'

const { hash } = await testClient.sendUnsignedTransaction({ // [!code focus:99]
const hash = await testClient.sendUnsignedTransaction({ // [!code focus:99]
from: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
value: 1000000000000000000n
})
// { hash: '0x...' }
// '0x...'
```

## Returns
Expand Down
4 changes: 2 additions & 2 deletions src/actions/test/getTxpoolContent.ts
Expand Up @@ -2,14 +2,14 @@ import { Address } from 'abitype'
import type { TestClient } from '../../clients'
import { RpcTransaction } from '../../types'

export type GetTxPoolContentResponse = {
export type GetTxpoolContentResponse = {
pending: Record<Address, Record<string, RpcTransaction>>
queued: Record<Address, Record<string, RpcTransaction>>
}

export async function getTxpoolContent(
client: TestClient,
): Promise<GetTxPoolContentResponse> {
): Promise<GetTxpoolContentResponse> {
return await client.request({
method: 'txpool_content',
})
Expand Down
4 changes: 2 additions & 2 deletions src/actions/test/getTxpoolStatus.ts
@@ -1,14 +1,14 @@
import type { TestClient } from '../../clients'
import { hexToNumber } from '../../utils'

export type GetTxPoolStatusResponse = {
export type GetTxpoolStatusResponse = {
pending: number
queued: number
}

export async function getTxpoolStatus(
client: TestClient,
): Promise<GetTxPoolStatusResponse> {
): Promise<GetTxpoolStatusResponse> {
const { pending, queued } = await client.request({
method: 'txpool_status',
})
Expand Down
4 changes: 2 additions & 2 deletions src/actions/test/index.ts
Expand Up @@ -5,10 +5,10 @@ export { getAutomine } from './getAutomine'
export type { GetAutomineResponse } from './getAutomine'

export { getTxpoolContent } from './getTxpoolContent'
export type { GetTxPoolContentResponse } from './getTxpoolContent'
export type { GetTxpoolContentResponse } from './getTxpoolContent'

export { getTxpoolStatus } from './getTxpoolStatus'
export type { GetTxPoolStatusResponse } from './getTxpoolStatus'
export type { GetTxpoolStatusResponse } from './getTxpoolStatus'

export { impersonateAccount } from './impersonateAccount'
export type { ImpersonateAccountArgs } from './impersonateAccount'
Expand Down
12 changes: 6 additions & 6 deletions src/clients/createTestClient.test.ts
Expand Up @@ -29,8 +29,8 @@ test('creates', () => {
"chain": undefined,
"dropTransaction": [Function],
"getAutomine": [Function],
"getTxPoolContent": [Function],
"getTxPoolStatus": [Function],
"getTxpoolContent": [Function],
"getTxpoolStatus": [Function],
"impersonateAccount": [Function],
"increaseTime": [Function],
"inspectTxpool": [Function],
Expand Down Expand Up @@ -109,8 +109,8 @@ describe('transports', () => {
},
"dropTransaction": [Function],
"getAutomine": [Function],
"getTxPoolContent": [Function],
"getTxPoolStatus": [Function],
"getTxpoolContent": [Function],
"getTxpoolStatus": [Function],
"impersonateAccount": [Function],
"increaseTime": [Function],
"inspectTxpool": [Function],
Expand Down Expand Up @@ -189,8 +189,8 @@ describe('transports', () => {
},
"dropTransaction": [Function],
"getAutomine": [Function],
"getTxPoolContent": [Function],
"getTxPoolStatus": [Function],
"getTxpoolContent": [Function],
"getTxpoolStatus": [Function],
"impersonateAccount": [Function],
"increaseTime": [Function],
"inspectTxpool": [Function],
Expand Down
12 changes: 6 additions & 6 deletions src/clients/decorators/test.test.ts
Expand Up @@ -19,8 +19,8 @@ test('default', async () => {
{
"dropTransaction": [Function],
"getAutomine": [Function],
"getTxPoolContent": [Function],
"getTxPoolStatus": [Function],
"getTxpoolContent": [Function],
"getTxpoolStatus": [Function],
"impersonateAccount": [Function],
"increaseTime": [Function],
"inspectTxpool": [Function],
Expand Down Expand Up @@ -64,12 +64,12 @@ describe('smoke test', () => {
expect(await testClient.getAutomine()).toBeDefined()
})

test('getTxPoolContent', async () => {
expect(await testClient.getTxPoolContent()).toBeDefined()
test('getTxpoolContent', async () => {
expect(await testClient.getTxpoolContent()).toBeDefined()
})

test('getTxPoolStatus', async () => {
expect(await testClient.getTxPoolStatus()).toBeDefined()
test('getTxpoolStatus', async () => {
expect(await testClient.getTxpoolStatus()).toBeDefined()
})

test.skip('impersonateAccount', async () => {
Expand Down
12 changes: 6 additions & 6 deletions src/clients/decorators/test.ts
@@ -1,8 +1,8 @@
import type {
DropTransactionArgs,
GetAutomineResponse,
GetTxPoolContentResponse,
GetTxPoolStatusResponse,
GetTxpoolContentResponse,
GetTxpoolStatusResponse,
ImpersonateAccountArgs,
IncreaseTimeArgs,
InspectTxpoolResponse,
Expand Down Expand Up @@ -60,8 +60,8 @@ import type { TestClient } from '../createTestClient'
export type TestActions<TChain extends Chain = Chain> = {
dropTransaction: (args: DropTransactionArgs) => Promise<void>
getAutomine: () => Promise<GetAutomineResponse>
getTxPoolContent: () => Promise<GetTxPoolContentResponse>
getTxPoolStatus: () => Promise<GetTxPoolStatusResponse>
getTxpoolContent: () => Promise<GetTxpoolContentResponse>
getTxpoolStatus: () => Promise<GetTxpoolStatusResponse>
impersonateAccount: (args: ImpersonateAccountArgs) => Promise<void>
increaseTime: (args: IncreaseTimeArgs) => Promise<Quantity>
inspectTxpool: () => Promise<InspectTxpoolResponse>
Expand Down Expand Up @@ -104,8 +104,8 @@ export const testActions = <
): TestActions<TChain> => ({
dropTransaction: (args) => dropTransaction(client, args),
getAutomine: () => getAutomine(client),
getTxPoolContent: () => getTxpoolContent(client),
getTxPoolStatus: () => getTxpoolStatus(client),
getTxpoolContent: () => getTxpoolContent(client),
getTxpoolStatus: () => getTxpoolStatus(client),
impersonateAccount: (args) => impersonateAccount(client, args),
increaseTime: (args) => increaseTime(client, args),
inspectTxpool: () => inspectTxpool(client),
Expand Down

2 comments on commit 057e01e

@vercel
Copy link

@vercel vercel bot commented on 057e01e Feb 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

viem-playground – ./playgrounds/browser

viem-playground.vercel.app
viem-playground-wagmi-dev.vercel.app
viem-playground-git-main-wagmi-dev.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 057e01e Feb 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

viem-site – ./site

viem.sh
viem-site.vercel.app
viem-site-wagmi-dev.vercel.app
viem-site-git-main-wagmi-dev.vercel.app
www.viem.sh

Please sign in to comment.