-
Notifications
You must be signed in to change notification settings - Fork 214
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(a3p): extend test coverage for Vaults on z:acceptance #10297
Conversation
Deploying agoric-sdk with Cloudflare Pages
|
a7c84c7
to
5b7b4d8
Compare
@Chris-Hibbert it looks like I'm behind on about 3 weeks of context here. So I'll leave this to you. LMK if you want me more involved. |
* @param {*} divideOp | ||
* @returns {import('@agoric/ertp/src/types.js').Amount<'nat'>} | ||
*/ | ||
const multiplyHelper = (amount, ratio, divideOp) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this duplicated from ratio.js
? Why is the rest of this file necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why this file was created was because when trying to install the @agoric/zoe package at the a3p-integration z:acceptance proposal, it failed because @agoric/xsnap package
couldn't be built successfully.
This issue describes the current behaviour in more detail (#10259)
I have included this as a Testing Considerations.
source: 'continuing', | ||
}, | ||
offerArgs: { | ||
deadline, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't deadline
be with respect to the chainTimer, and not Date.now()
? It looks like this is pervasive throughout these tests. Do we need a separate issue to refactor these tests to use timeMath and times from the chainTimer?
Is the chainTimer in a3p on wall-clock time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function was indeed extracted from an existing test helper file vaults.mts, and I agree with your observation that this Date.now()
behavior appears consistently throughout the a3p-integration
tests.
It would make sense to open an issue to refactor these tests, provided there is agreement to move toward using chainTimer
and timeMath
for consistency and accuracy in deadline calculations.
As for whether the chainTimer
itself is on wall-clock time, I’m not sure, but I will dig deeper on the subject
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc: @anilhelvaci
const GOV4ADDR = 'agoric1c9gyu460lu70rtcdp95vummd6032psmpdx7wdy'; | ||
const govAccounts = [GOV1ADDR, GOV2ADDR, GOV4ADDR]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please import these from some common location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Gov4
address is currently declared in multiple locations across a3p-integration
. Given its upcoming use in governance, we intend to open a ticket for the next sprint to enable importing Gov4
from synthetic-chain
. Once implemented, we’ll refactor the following files to reference the new common location:
a3p-integration/proposals/z:acceptance/governance.test.js
a3p-integration/proposals/z:acceptance/lib/vaults.mts
a3p-integration/proposals/z:acceptance/vaults.test.js
a3p-integration/proposals/n:upgrade-next/agoric-tools.js
In the meantime, would it be possible to proceed with landing this PR as is?
/* | ||
* The long-living-vault user is being created and used to open a vault in the n:upgrade-next proposal USE phase. | ||
* The offer to open a vault is implemented in a3p-integration/proposals/n:upgrade-next/openVault.js | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is acceptable on an interim basis, but it would better and cleaner to add a vault in the use phase of something in agoric-3-proposals
so we don't have to rely on retaining this open vault in n:upgrade-next
, which will continuously evolve as we push out releases.
After this PR, would you make a PR that opens a vault there that we can use the next time we need one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that opening a vault in one of the agoric-3-proposals
would be a more robust and sustainable solution.
I'll take on this task and open a ticket to add it to our sprint backlog, ensuring we have a dedicated PR for that work.
Thank you for highlighting this improvement.
e9c8907
to
c9a7008
Compare
b51397a
to
0ff52c0
Compare
16a1d81
to
ef7dfe8
Compare
The CI action responsible for running proposal tests failed because the Gov2 wallet didn’t have sufficient funds to cover transaction fees, which prevented it from voting on the proposed change. While reviewing the governance tests, I noticed that since these tests validate the proper functioning of the economic committee, they should be executed before the vaults tests. Specifically, the "User can pay off debt when totalDebt is above debtLimit" test in To address these issues, the commit ee650c5:
|
closes: https://github.com/Agoric/BytePitchPartnerEng/issues/22
closes: https://github.com/Agoric/BytePitchPartnerEng/issues/15
Description
The purpose of this PR is to extend the
z:acceptance
testing coverage ofVaults
to include the following cases:The existing tests were also refactored to take advantage of the new helper functions built and also included in this PR.
In addition to extending the test cases, other key update is the introduction of a new script,
openVault.js
, to open a new vault in theuse
phase ofn:upgrade-next
proposal.This process allow us to test that vaults that existed before the most recent upgrade continue to be useable
A more detailed discussion of the decisions made for the implementations above can be found on the issue: https://github.com/Agoric/BytePitchPartnerEng/issues/22
Security Considerations
none
Scaling Considerations
none
Documentation Considerations
none
Testing Considerations
This PR included a new file,
/z:acceptance/test-lib/ratio.js
, which exports the methodceilMultiplyBy
, which is also exported by the@agoric/zoe
package.The reason why this file was created was because when trying to install the
@agoric/zoe
package at the a3p-integration z:acceptance proposal, it failed because@agoric/xsnap
package couldn't be built successfully.As described in the issue #10259
When resolved, the
ratio.js
file should be removed and theceilMultiplyBy
method should be imported from the@agoric/zoe
package.Upgrade Considerations
none