Skip to content

Commit

Permalink
fix option (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci authored Jan 4, 2024
1 parent fd1d5de commit e26e1cc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
8 changes: 5 additions & 3 deletions packages/chopsticks/src/plugins/dry-run/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import type { Argv } from 'yargs'

const schema = z.object({
...configSchema.shape,
extrinsic: z.string({
description: 'Extrinsic or call to dry run. If you pass call here then address is required to fake signature',
}),
extrinsic: z
.string({
description: 'Extrinsic or call to dry run. If you pass call here then address is required to fake signature',
})
.optional(),
address: z
.string({
description: 'Address to fake sign extrinsic',
Expand Down
4 changes: 4 additions & 0 deletions packages/chopsticks/src/plugins/dry-run/dry-run-extrinsic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import { setupContext } from '../../context.js'
export const dryRunExtrinsic = async (argv: DryRunSchemaType) => {
const context = await setupContext(argv)

if (!argv.extrinsic) {
throw new Error('Extrinsic is required')
}

const input = argv['address']
? { call: argv['extrinsic'] as HexString, address: argv['address'] }
: (argv['extrinsic'] as HexString)
Expand Down
8 changes: 5 additions & 3 deletions packages/chopsticks/src/plugins/dry-run/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import { z } from 'zod'

export const dryRunSchema = z.object({
...configSchema.shape,
extrinsic: z.string({
description: 'Extrinsic or call to dry run. If you pass call here then address is required to fake signature',
}),
extrinsic: z
.string({
description: 'Extrinsic or call to dry run. If you pass call here then address is required to fake signature',
})
.optional(),
address: z
.string({
description: 'Address to fake sign extrinsic',
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e/src/block.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ describe('block', async () => {
const promises: Promise<any>[] = []
expect(await chain.upcomingBlocks()).toEqual(0)
promises.push(dev.newBlock())
await delay(10)
await delay(20)
expect(await chain.upcomingBlocks()).toEqual(1)

promises.push(dev.newBlock())
promises.push(dev.newBlock())
await delay(10)
await delay(20)
expect(await chain.upcomingBlocks()).toEqual(2)

await Promise.all(promises)
Expand Down

0 comments on commit e26e1cc

Please sign in to comment.