-
Notifications
You must be signed in to change notification settings - Fork 13
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
Mark off-boarded collaterals on the dashboard #595
base: main
Are you sure you want to change the base?
Conversation
@@ -11,7 +11,7 @@ | |||
<CurrencyIcon :currency-symbol="record.symbol" /> | |||
</div> | |||
<div slot="ilk" slot-scope="ilk" class="Element"> | |||
{{ ilk }} | |||
{{ ilk }} <span v-if="isCollateralOffboarded(ilk)" class="opacity-50"> (off-boarded)</span> |
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.
Nit: we might just use a separate column for that with off-boarded
/active
label
async isCollateralOffboarded( | ||
{ rootGetters }: ActionContext<State, State>, | ||
collateralType: string | ||
): Promise<boolean> { | ||
const network = rootGetters['network/getMakerNetwork']; | ||
if (!network) { | ||
return false; | ||
} | ||
const typeHex = ethers.utils.formatBytes32String(collateralType); | ||
const maxCollateralDebt = await getContractValue(network, 'MCD_VAT', 'ilks', { | ||
parameters: [typeHex], | ||
variableName: 'line', | ||
decimalUnits: 'RAD', | ||
}); | ||
return maxCollateralDebt.isZero(); | ||
}, |
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 move this function to the appropriate place in the
core
- Then, please just call
isCollateralOffboarded
inside existingfetchCollateralStatus
action to add the values to the type - Then, you no longer need to pass any other new props to the dashboard, and can just use existing
status.isOffboarded
to display the appropriate label
Do you see any problems with this suggestion or why did you have to introduce all those new props and extra types like offBoardedCollaterals
array?
Closes #594.
Checklist:
#
)