mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-24 23:35:19 +00:00
This commit is contained in:
parent
eb1cec7d5c
commit
86de5011f2
@ -19,6 +19,7 @@ import (
|
|||||||
auctiontypes "github.com/kava-labs/kava/x/auction/types"
|
auctiontypes "github.com/kava-labs/kava/x/auction/types"
|
||||||
v017bep3 "github.com/kava-labs/kava/x/bep3/legacy/v0_17"
|
v017bep3 "github.com/kava-labs/kava/x/bep3/legacy/v0_17"
|
||||||
bep3types "github.com/kava-labs/kava/x/bep3/types"
|
bep3types "github.com/kava-labs/kava/x/bep3/types"
|
||||||
|
cdptypes "github.com/kava-labs/kava/x/cdp/types"
|
||||||
committeetypes "github.com/kava-labs/kava/x/committee/types"
|
committeetypes "github.com/kava-labs/kava/x/committee/types"
|
||||||
incentivetypes "github.com/kava-labs/kava/x/incentive/types"
|
incentivetypes "github.com/kava-labs/kava/x/incentive/types"
|
||||||
savingstypes "github.com/kava-labs/kava/x/savings/types"
|
savingstypes "github.com/kava-labs/kava/x/savings/types"
|
||||||
@ -76,6 +77,17 @@ func migrateAppState(appState genutiltypes.AppMap, clientCtx client.Context) {
|
|||||||
authzState := authz.DefaultGenesisState()
|
authzState := authz.DefaultGenesisState()
|
||||||
appState[authz.ModuleName] = codec.MustMarshalJSON(authzState)
|
appState[authz.ModuleName] = codec.MustMarshalJSON(authzState)
|
||||||
|
|
||||||
|
// x/cdp
|
||||||
|
if appState[cdptypes.ModuleName] != nil {
|
||||||
|
var genState cdptypes.GenesisState
|
||||||
|
codec.MustUnmarshalJSON(appState[cdptypes.ModuleName], &genState)
|
||||||
|
|
||||||
|
genState.Params.GlobalDebtLimit = sdk.NewCoin("usdx", sdk.NewInt(393000000000000))
|
||||||
|
encodedState := codec.MustMarshalJSON(&genState)
|
||||||
|
|
||||||
|
appState[cdptypes.ModuleName] = encodedState
|
||||||
|
}
|
||||||
|
|
||||||
// x/auction
|
// x/auction
|
||||||
if appState[auctiontypes.ModuleName] != nil {
|
if appState[auctiontypes.ModuleName] != nil {
|
||||||
var v16GenState v016auction.GenesisState
|
var v16GenState v016auction.GenesisState
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
feemarkettypes "github.com/tharsis/ethermint/x/feemarket/types"
|
feemarkettypes "github.com/tharsis/ethermint/x/feemarket/types"
|
||||||
|
|
||||||
auctiontypes "github.com/kava-labs/kava/x/auction/types"
|
auctiontypes "github.com/kava-labs/kava/x/auction/types"
|
||||||
|
cdptypes "github.com/kava-labs/kava/x/cdp/types"
|
||||||
evmutiltypes "github.com/kava-labs/kava/x/evmutil/types"
|
evmutiltypes "github.com/kava-labs/kava/x/evmutil/types"
|
||||||
incentivetypes "github.com/kava-labs/kava/x/incentive/types"
|
incentivetypes "github.com/kava-labs/kava/x/incentive/types"
|
||||||
savingstypes "github.com/kava-labs/kava/x/savings/types"
|
savingstypes "github.com/kava-labs/kava/x/savings/types"
|
||||||
@ -68,6 +69,14 @@ func TestMigrateEvm(t *testing.T) {
|
|||||||
}, genstate.Params)
|
}, genstate.Params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestMigrateCDP(t *testing.T) {
|
||||||
|
appMap, ctx := migrateToV17AndGetAppMap(t)
|
||||||
|
var genstate cdptypes.GenesisState
|
||||||
|
err := ctx.Codec.UnmarshalJSON(appMap[cdptypes.ModuleName], &genstate)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Equal(t, genstate.Params.GlobalDebtLimit, sdk.NewCoin("usdx", sdk.NewInt(393000000000000)))
|
||||||
|
}
|
||||||
|
|
||||||
func TestMigrateAuction(t *testing.T) {
|
func TestMigrateAuction(t *testing.T) {
|
||||||
appMap, ctx := migrateToV17AndGetAppMap(t)
|
appMap, ctx := migrateToV17AndGetAppMap(t)
|
||||||
var genstate auctiontypes.GenesisState
|
var genstate auctiontypes.GenesisState
|
||||||
|
2
migrate/v0_17/testdata/genesis-v17.json
vendored
2
migrate/v0_17/testdata/genesis-v17.json
vendored
@ -639,7 +639,7 @@
|
|||||||
"conversion_factor": "6",
|
"conversion_factor": "6",
|
||||||
"debt_floor": "10000000"
|
"debt_floor": "10000000"
|
||||||
},
|
},
|
||||||
"global_debt_limit": { "denom": "usdx", "amount": "43000000000000" },
|
"global_debt_limit": { "denom": "usdx", "amount": "393000000000000" },
|
||||||
"surplus_auction_threshold": "500000000000",
|
"surplus_auction_threshold": "500000000000",
|
||||||
"surplus_auction_lot": "10000000000",
|
"surplus_auction_lot": "10000000000",
|
||||||
"debt_auction_threshold": "100000000000",
|
"debt_auction_threshold": "100000000000",
|
||||||
|
Loading…
Reference in New Issue
Block a user