Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/getNitroContractVersions.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('getNitroContractVersions', () => {
);
});

it('throws when the JSON payload is missing top level fields', async () => {
it('throws when the result is missing top-level fields', async () => {
vi.mocked(runChainVersioner).mockResolvedValueOnce({
versions: { Inbox: 'v1.1.1' },
} as never);
Expand All @@ -52,7 +52,7 @@ describe('getNitroContractVersions', () => {
).rejects.toThrow('Failed to parse Nitro contract versions');
});

it('accepts any JSON payload that includes versions and upgradeRecommendation', async () => {
it('accepts any result that includes versions and upgradeRecommendation', async () => {
vi.mocked(runChainVersioner).mockResolvedValueOnce({
versions: 'not-validated',
upgradeRecommendation: null,
Expand Down
3 changes: 3 additions & 0 deletions src/scripting/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@
schema as deployFullChainSchema,
execute as deployFullChainExecute,
} from './workflows/deployFullChain';
import { getChainContractVersions } from '../getChainContractVersions';

Check failure on line 133 in src/scripting/commands.ts

View workflow job for this annotation

GitHub Actions / Test (Type)

Cannot find module '../getChainContractVersions' or its corresponding type declarations.

Check failure on line 133 in src/scripting/commands.ts

View workflow job for this annotation

GitHub Actions / Test (Unit)

Cannot find module '../getChainContractVersions' or its corresponding type declarations.

Check failure on line 133 in src/scripting/commands.ts

View workflow job for this annotation

GitHub Actions / Test (Integration) - Arbitrum Testnode - Nitro contracts v3.2 - Custom gas token with 18 decimals

Cannot find module '../getChainContractVersions' or its corresponding type declarations.

Check failure on line 133 in src/scripting/commands.ts

View workflow job for this annotation

GitHub Actions / Test (Integration) - Nitro contracts v2.1 - Custom gas token with 18 decimals

Cannot find module '../getChainContractVersions' or its corresponding type declarations.

Check failure on line 133 in src/scripting/commands.ts

View workflow job for this annotation

GitHub Actions / Test (Integration) - Nitro contracts v2.1 - Custom gas token with 6 decimals

Cannot find module '../getChainContractVersions' or its corresponding type declarations.
import { getChainContractVersionsSchema } from './schemas/getChainContractVersions';

import { contractRegistry } from './contractRegistry';
import { buildContractCommandSchema } from './contractCommandSchema';
Expand Down Expand Up @@ -366,4 +368,5 @@
),

...contractCommands,
command('getChainContractVersions', getChainContractVersionsSchema, getChainContractVersions),
];
3 changes: 3 additions & 0 deletions src/scripting/schemaCoverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ vi.mock('viem', async (importOriginal) => {
};
});

vi.mock('../getChainContractVersions', () => ({
getChainContractVersions: _mocks.fn('getChainContractVersions'),
}));
/**
* A testable leaf of a schema -- a scalar field the harness will vary when
* running coverage.
Expand Down
17 changes: 17 additions & 0 deletions src/scripting/schemas/getChainContractVersions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { z } from 'zod';

import { getChainContractVersions } from '../../getChainContractVersions';

Check failure on line 3 in src/scripting/schemas/getChainContractVersions.ts

View workflow job for this annotation

GitHub Actions / Test (Type)

Cannot find module '../../getChainContractVersions' or its corresponding type declarations.

Check failure on line 3 in src/scripting/schemas/getChainContractVersions.ts

View workflow job for this annotation

GitHub Actions / Test (Unit)

Cannot find module '../../getChainContractVersions' or its corresponding type declarations.

Check failure on line 3 in src/scripting/schemas/getChainContractVersions.ts

View workflow job for this annotation

GitHub Actions / Test (Integration) - Arbitrum Testnode - Nitro contracts v3.2 - Custom gas token with 18 decimals

Cannot find module '../../getChainContractVersions' or its corresponding type declarations.

Check failure on line 3 in src/scripting/schemas/getChainContractVersions.ts

View workflow job for this annotation

GitHub Actions / Test (Integration) - Nitro contracts v2.1 - Custom gas token with 18 decimals

Cannot find module '../../getChainContractVersions' or its corresponding type declarations.

Check failure on line 3 in src/scripting/schemas/getChainContractVersions.ts

View workflow job for this annotation

GitHub Actions / Test (Integration) - Nitro contracts v2.1 - Custom gas token with 6 decimals

Cannot find module '../../getChainContractVersions' or its corresponding type declarations.
import { addressSchema } from './common';

export const getChainContractVersionsSchema = z
.object({
inboxAddress: addressSchema,
parentChainRpc: z.url(),
})
.strict()
.transform(
(input): Parameters<typeof getChainContractVersions> => [
input.inboxAddress,
input.parentChainRpc,
],
);
1 change: 1 addition & 0 deletions src/scripting/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ export {
isAllowListEnabledSchema,
isAllowedSchema,
} from './actions';
export { getChainContractVersionsSchema } from './getChainContractVersions';
Loading