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

vaults: gov active-collateral #20

Closed
wants to merge 5 commits into from
Closed

Conversation

DongLieu
Copy link
Collaborator

@DongLieu DongLieu commented Sep 19, 2024

add gov active-collateral for vaults module

Test: run ./script/vaults-gov-test.sh

@DongLieu DongLieu requested a review from hieuvubk September 19, 2024 09:08

option go_package = "github.com/onomyprotocol/reserve/x/vaults/types";

message ActiveCollateralProposal {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should add a param oracleScriptId to support query price of asset in oracle module
cc: here


option go_package = "github.com/onomyprotocol/reserve/x/vaults/types";

message ActiveCollateralProposal {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should change the name to ActiveCollateralAssetProposal

return func(ctx sdk.Context, content govtypes.Content) error {
switch c := content.(type) {
case *types.ActiveCollateralProposal:
return k.ActiveCollateralAsset(ctx, c.Denom, c.MinCollateralRatio, c.LiquidationRatio, c.MaxDebt)
Copy link
Collaborator

Choose a reason for hiding this comment

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

And in this function, we should call this func to add asset to query list

@@ -8,5 +8,6 @@ import (

// x/vaults module sentinel errors
var (
ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message")
ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Register should start from 1


}

func NewActiveCollateralProposal(title, description, denom string, minCollateralRatio, liquidationRatio math.LegacyDec, maxDebt math.Int) ActiveCollateralProposal {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should change the name to NewActiveCollateralAssetProposal

@vuong177 vuong177 closed this Sep 30, 2024
@DongLieu DongLieu deleted the dong/gov-vaults branch October 11, 2024 09: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.

3 participants