-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
|
||
option go_package = "github.com/onomyprotocol/reserve/x/vaults/types"; | ||
|
||
message ActiveCollateralProposal { |
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.
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 { |
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.
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) |
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.
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") |
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.
Register should start from 1
|
||
} | ||
|
||
func NewActiveCollateralProposal(title, description, denom string, minCollateralRatio, liquidationRatio math.LegacyDec, maxDebt math.Int) ActiveCollateralProposal { |
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.
Should change the name to NewActiveCollateralAssetProposal
add gov active-collateral for vaults module
Test: run ./script/vaults-gov-test.sh