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

test: After updating vaultFactory params, verify the change #10803

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Chris-Hibbert
Copy link
Contributor

Description

We noticed that after changing params for the VaultFactory, the test verified that the vote had completed, but not that the param change was effective. For a while we suspected that the change didn't take, but a simple enhancement to the test showed that wasn't the case.

Security Considerations

None

Scaling Considerations

None

Documentation Considerations

None

Testing Considerations

Tests should verify the actual changes they make.

Upgrade Considerations

This was one red herring we chased while validating upgrade. A clearer test would have made that chase shorter.

@Chris-Hibbert Chris-Hibbert self-assigned this Jan 6, 2025
@Chris-Hibbert Chris-Hibbert requested a review from a team as a code owner January 6, 2025 18:13
@Chris-Hibbert Chris-Hibbert added the force:integration Force integration tests to run on PR label Jan 6, 2025
Copy link
Collaborator

@Jorge-Lopes Jorge-Lopes left a comment

Choose a reason for hiding this comment

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

The assertion introduced in this PR is already covered in the subsequent test case, here.

However, I can understand if you find more appropriate to explicitly verify that the governed parameter was indeed updated in order to pass the economic committee can make governance proposal and vote on it test case.

Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

a couple thoughts...

t.is(
// @ts-expect-error it's a record
vaultFactoryParamsAfter.current.ChargingPeriod.value,
400n,
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure it wasn't 400n before?

Copy link
Member

Choose a reason for hiding this comment

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

also: we talked about revising governanceDriver.waitForElection() to pay attention to which question is relevant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are we sure it wasn't 400n before?

I've added a set-up step

also: we talked about revising governanceDriver.waitForElection() to pay attention to which question is relevant.

The governanceDriver remembers the deadline from proposeParamChange(), and verifies it in waitForElection().

Copy link

cloudflare-workers-and-pages bot commented Jan 7, 2025

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: ed61157
Status: ✅  Deploy successful!
Preview URL: https://81d44cd1.agoric-sdk.pages.dev
Branch Preview URL: https://cth-check-vf-params-after-up.agoric-sdk.pages.dev

View logs

@Chris-Hibbert Chris-Hibbert requested a review from dckc January 7, 2025 20:54
Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

looks good.

1 suggestion (applies 2x). not critical

Comment on lines 24 to 35
// @ts-expect-error it's a record
vaultFactoryParamsBefore.current.ChargingPeriod.value === 400n
Copy link
Member

Choose a reason for hiding this comment

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

Rather than a ts-expect-error here at the point of usage, I suggest fixing the type at the point of declaration. A ts-expect-error there may or may not be necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 74 to 83
// @ts-expect-error it's a record
vaultFactoryParamsAfter.current.ChargingPeriod.value,
Copy link
Member

Choose a reason for hiding this comment

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

likewise, I suggest fixing the decl of vaultFactoryParamsAfter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@Chris-Hibbert Chris-Hibbert added automerge:rebase Automatically rebase updates, then merge and removed automerge:rebase Automatically rebase updates, then merge labels Jan 22, 2025
@Chris-Hibbert Chris-Hibbert force-pushed the cth-check-vf-params-after-update branch from 1907728 to 4f52d8f Compare January 23, 2025 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contract-upgrade force:integration Force integration tests to run on PR test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants