Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add GET_PROTOCOL_PARAMETERS #272

Merged
merged 3 commits into from
Nov 29, 2024
Merged

Conversation

iccicci
Copy link
Collaborator

@iccicci iccicci commented Nov 21, 2024

This should solve #254

test/e2e/fixtures/preprod/get-protocol-parameters.e2e.ts Outdated Show resolved Hide resolved
test/e2e/tests/get-protocolp-parameters.e2e.test.ts Outdated Show resolved Hide resolved
test/e2e/fixtures/preprod/get-protocol-parameters.e2e.ts Outdated Show resolved Hide resolved
test(fixture.testName, async () => {
const ws = getWebSocketClient();
const { cost_models, ...data } = await ws.sendAndWait('GET_PROTOCOL_PARAMETERS');
expect(data).toMatchObject(fixture.result);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
expect(data).toMatchObject(fixture.result);
expect(data).toStrictEqual(fixture.result);

I prefer using toStrictEqual in this case. The fixture could be missing some data (as it is now missing cost_models) which could go unnoticed with a less strict assertion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

c9ce170 should solve this

PlutusV2: expect.arrayContaining([expect.any(Number)]),
PlutusV3: expect.arrayContaining([expect.any(Number)]),
},
price_mem: 0.0577,
Copy link
Contributor

Choose a reason for hiding this comment

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

missing cost_models

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wasn't able to find a way to describe the cost_models object with combinations of expects: the object is explicitly checked in the test file.

c9ce170 should solve this

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's begin with the strictest version and gradually relax the requirements if needed.
I added checking whole cost_models d976784

@iccicci iccicci force-pushed the feat/get_protocol_parameters branch from 75c3a44 to c9ce170 Compare November 27, 2024 14:18
@iccicci iccicci merged commit 41f1bb8 into master Nov 29, 2024
3 checks passed
@iccicci iccicci deleted the feat/get_protocol_parameters branch November 29, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants