2022-04-22 18:36:05 +00:00
|
|
|
package v0_17
|
|
|
|
|
|
|
|
import (
|
2024-05-01 03:17:24 +00:00
|
|
|
v016auction "github.com/0glabs/0g-chain/x/auction/legacy/v0_16"
|
|
|
|
v017auction "github.com/0glabs/0g-chain/x/auction/types"
|
2022-04-22 18:36:05 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func Migrate(oldState v016auction.GenesisState) *v017auction.GenesisState {
|
|
|
|
return &v017auction.GenesisState{
|
|
|
|
NextAuctionId: oldState.NextAuctionId,
|
|
|
|
Params: migrateParams(oldState.Params),
|
|
|
|
Auctions: oldState.Auctions,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func migrateParams(params v016auction.Params) v017auction.Params {
|
|
|
|
return v017auction.Params{
|
|
|
|
MaxAuctionDuration: params.MaxAuctionDuration,
|
|
|
|
ForwardBidDuration: v017auction.DefaultForwardBidDuration,
|
|
|
|
ReverseBidDuration: v017auction.DefaultReverseBidDuration,
|
|
|
|
IncrementSurplus: params.IncrementSurplus,
|
|
|
|
IncrementDebt: params.IncrementDebt,
|
|
|
|
IncrementCollateral: params.IncrementCollateral,
|
|
|
|
}
|
|
|
|
}
|