Skip to content

Commit

Permalink
Merge pull request #601 from UnUniFi/fix/iya-param
Browse files Browse the repository at this point in the history
fix: iya default param
  • Loading branch information
Senna46 authored Jun 12, 2023
2 parents a7b213a + f5fea67 commit 6f384f9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Install Go. Use the 19.x series version.

```bash
$ wget https://go.dev/dl/go1.19.2.linux-amd64.tar.gz
$ rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.2.linux-amd64.tar.gz
$ sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.19.2.linux-amd64.tar.gz
$ vim ~/.bashrc
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
$ source ~/.bashrc
$ go version
go version go1.19.2 linux/amd64
Expand Down
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1479,4 +1479,5 @@ func (app *App) setupAppkeeper() {
app.AppKeepers.ConsensusParamsKeeper = &app.ConsensusParamsKeeper
app.AppKeepers.ParamsKeeper = &app.ParamsKeeper
app.AppKeepers.WasmKeeper = &app.WasmKeeper
app.AppKeepers.YieldaggregatorKeeper = &app.YieldaggregatorKeeper
}
5 changes: 5 additions & 0 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"

yieldaggregatorKeeper "github.com/UnUniFi/chain/x/yieldaggregator/keeper"
)

type AppKeepers struct {
Expand All @@ -38,4 +40,7 @@ type AppKeepers struct {
DistrKeeper *distrkeeper.Keeper

WasmKeeper *wasmkeeper.Keeper

// ununifi original keepers
YieldaggregatorKeeper *yieldaggregatorKeeper.Keeper
}
6 changes: 6 additions & 0 deletions app/upgrades/v3/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ func CreateUpgradeHandler(mm *module.Manager,
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info(fmt.Sprintf("update start:%s", UpgradeName))

iyaParam := keepers.YieldaggregatorKeeper.GetParams(ctx)
iyaParam.CommissionRate = sdk.NewDecWithPrec(1, 3)
iyaParam.VaultCreationFee = sdk.NewCoin("uguu", sdk.NewInt(10000000))
iyaParam.VaultCreationDeposit = sdk.NewCoin("uguu", sdk.NewInt(1000000))

keepers.YieldaggregatorKeeper.SetParams(ctx, iyaParam)
return mm.RunMigrations(ctx, configurator, vm)
}
}
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is an example for Ubuntu.

```shell
apt update
apt install build-essential
apt install build-essential unzip
cd ~
wget https://dl.google.com/go/go1.14.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.14.linux-amd64.tar.gz
Expand Down

0 comments on commit 6f384f9

Please sign in to comment.