-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #361 from irisnet/dreamer/farm-params-migration
refactor: migrate farm params
- Loading branch information
Showing
26 changed files
with
1,010 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package types | ||
|
||
import ( | ||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" | ||
) | ||
|
||
// Parameter store keys | ||
var ( | ||
KeyFee = []byte("Fee") // fee key | ||
KeyPoolCreationFee = []byte("PoolCreationFee") // fee key | ||
KeyTaxRate = []byte("TaxRate") // fee key | ||
KeyStandardDenom = []byte("StandardDenom") // standard token denom key | ||
KeyUnilateralLiquidityFee = []byte("UnilateralLiquidityFee") // fee key | ||
) | ||
|
||
// ParamKeyTable returns the TypeTable for coinswap module | ||
func ParamKeyTable() paramtypes.KeyTable { | ||
return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) | ||
} | ||
|
||
// ParamSetPairs implements paramtypes.KeyValuePairs | ||
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { | ||
return paramtypes.ParamSetPairs{ | ||
paramtypes.NewParamSetPair(KeyFee, &p.Fee, validateFee), | ||
paramtypes.NewParamSetPair(KeyPoolCreationFee, &p.PoolCreationFee, validatePoolCreationFee), | ||
paramtypes.NewParamSetPair(KeyTaxRate, &p.TaxRate, validateTaxRate), | ||
paramtypes.NewParamSetPair( | ||
KeyUnilateralLiquidityFee, | ||
&p.UnilateralLiquidityFee, | ||
validateUnilateraLiquiditylFee, | ||
), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package exported | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" | ||
) | ||
|
||
var ( | ||
NewParamSetPair = paramtypes.NewParamSetPair | ||
) | ||
|
||
type ( | ||
ParamSet = paramtypes.ParamSet | ||
ParamSetPairs = paramtypes.ParamSetPairs | ||
|
||
// Subspace defines an interface that implements the legacy x/params Subspace | ||
// type. | ||
// | ||
// NOTE: This is used solely for migration of x/params managed parameters. | ||
Subspace interface { | ||
GetParamSet(ctx sdk.Context, ps ParamSet) | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.