-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix denom problem, add upgrade handler for stablestake * Resolve the usage of deposit denom * fix: stablestake migration --------- Co-authored-by: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com>
- Loading branch information
1 parent
6750ddd
commit 4ab7cbe
Showing
11 changed files
with
86 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
# query params | ||
elysd query bank balances $(elysd keys show -a treasury --keyring-backend=test) | ||
|
||
elysd query stablestake params | ||
# params: | ||
# deposit_denom: uusdc | ||
# epoch_length: "1" | ||
# health_gain_factor: "1.000000000000000000" | ||
# interest_rate: "0.150000000000000000" | ||
# interest_rate_decrease: "0.010000000000000000" | ||
# interest_rate_increase: "0.010000000000000000" | ||
# interest_rate_max: "0.170000000000000000" | ||
# interest_rate_min: "0.120000000000000000" | ||
# redemption_rate: "1.000000000000000000" | ||
# total_value: "100000000" | ||
elysd query stablestake borrow-ratio | ||
# borrow_ratio: "0.000000000000000000" | ||
# total_borrow: "0" | ||
# total_deposit: "100000000" | ||
|
||
elysd tx stablestake bond 100000000 --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000 | ||
|
||
|
||
# Testnet | ||
elysd tx stablestake bond 112131 --from=t2a --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000 --node=https://rpc.testnet.elys.network:443 --fees=250uelys |
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
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,13 @@ | ||
package migrations | ||
|
||
import ( | ||
"github.com/elys-network/elys/x/stablestake/keeper" | ||
) | ||
|
||
type Migrator struct { | ||
keeper keeper.Keeper | ||
} | ||
|
||
func NewMigrator(keeper keeper.Keeper) Migrator { | ||
return Migrator{keeper: keeper} | ||
} |
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,14 @@ | ||
package migrations | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/elys-network/elys/x/stablestake/types" | ||
) | ||
|
||
func (m Migrator) V2Migration(ctx sdk.Context) error { | ||
oldParams := m.keeper.GetParams(ctx) | ||
params := types.DefaultParams() | ||
params.TotalValue = oldParams.TotalValue | ||
m.keeper.SetParams(ctx, params) | ||
return nil | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.