-
Notifications
You must be signed in to change notification settings - Fork 152
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
Updateable reserveRatio for GNS #515
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #515 +/- ##
==========================================
+ Coverage 91.91% 91.96% +0.04%
==========================================
Files 33 33
Lines 1658 1667 +9
Branches 282 284 +2
==========================================
+ Hits 1524 1533 +9
Misses 134 134
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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've left some comments
) | ||
|
||
const pool = await gns.nameSignals(me.address, 0) | ||
const reserveRatio = pool[3] |
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.
gns.nameSignals(me.address, 0)
returns an object that lets you access attributes by both position and key:
[
BigNumber { _hex: '0x858ffc3f497c9112', _isBigNumber: true },
BigNumber { _hex: '0x874391d0dd1fdf42', _isBigNumber: true },
'0x71a94176484d9e0d2ff853a92e162a0493fafa1823a0841400c054769bd895a1',
10,
false,
BigNumber { _hex: '0x00', _isBigNumber: true },
vSignal: BigNumber { _hex: '0x858ffc3f497c9112', _isBigNumber: true },
nSignal: BigNumber { _hex: '0x874391d0dd1fdf42', _isBigNumber: true },
subgraphDeploymentID: '0x71a94176484d9e0d2ff853a92e162a0493fafa1823a0841400c054769bd895a1',
reserveRatio: 10,
disabled: false,
withdrawableGRT: BigNumber { _hex: '0x00', _isBigNumber: true }
]
You should be able to do something like:
expect(pool.reserveRatio).eq(value)
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 was following the pattern used here: https://github.com/graphprotocol/contracts/blob/dev/test/gns.test.ts#L157-L159
Wanted to make sure to edit and mutate as little as possible with this PR
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.
Summary
We currently have no way to set
reserveRatio
in the GNS contract through governance.Solution
Add a
setReserveRatio
function that allows us to setreserverRatio