diff --git a/proto/dymensionxyz/dymension/iro/tx.proto b/proto/dymensionxyz/dymension/iro/tx.proto index 78b2af24d..064a7db84 100644 --- a/proto/dymensionxyz/dymension/iro/tx.proto +++ b/proto/dymensionxyz/dymension/iro/tx.proto @@ -5,6 +5,7 @@ import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; import "dymensionxyz/dymension/iro/iro.proto"; +import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; @@ -64,9 +65,9 @@ message MsgCreatePlan { google.protobuf.Timestamp start_time = 5 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; - // The time before which the rollapp cannot be started. - google.protobuf.Timestamp pre_launch_time = 6 - [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + // The duration of the plan. + google.protobuf.Duration iro_plan_duration = 6 + [ (gogoproto.stdduration) = true, (gogoproto.nullable) = false ]; // The incentive plan parameters for the tokens left after the plan is settled. IncentivePlanParams incentive_plan_params = 7 [ (gogoproto.nullable) = false ]; diff --git a/proto/dymensionxyz/dymension/rollapp/rollapp.proto b/proto/dymensionxyz/dymension/rollapp/rollapp.proto index b3d0a943a..7659cd856 100644 --- a/proto/dymensionxyz/dymension/rollapp/rollapp.proto +++ b/proto/dymensionxyz/dymension/rollapp/rollapp.proto @@ -67,8 +67,7 @@ message Rollapp { // pre_launch_time is the timestamp indicating the time before which the // rollapp cannot be started. // Set when creating IRO plan for the rollapp - google.protobuf.Timestamp pre_launch_time = 16 - [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + google.protobuf.Timestamp pre_launch_time = 16 [ (gogoproto.stdtime) = true]; // LivenessEventHeight is the height of an upcoming liveness event (slash or // jail) 0 means not set int64 liveness_event_height = 17; diff --git a/x/iro/cli/tx_create_iro.go b/x/iro/cli/tx_create_iro.go index a267bb4b2..d9a63c5c2 100644 --- a/x/iro/cli/tx_create_iro.go +++ b/x/iro/cli/tx_create_iro.go @@ -19,14 +19,14 @@ import ( func CmdCreateIRO() *cobra.Command { cmd := &cobra.Command{ - Use: "create-iro [rollapp-id] [allocation] [pre-launch-time]", + Use: "create-iro [rollapp-id] [allocation] [duration]", Short: "Create a new Initial RollApp Offering (IRO) plan", Long: `Create a new Initial RollApp Offering (IRO) plan for a specific RollApp. Parameters: - [rollapp-id] : The unique identifier of the RollApp for which the IRO is being created. - [allocation] : The total amount of tokens to be allocated for the IRO. - [pre-launch-time] : The time before which the IRO cannot be launched. Can be in Unix timestamp or RFC3339 format. + [rollapp-id] : The unique identifier of the RollApp for which the IRO is being created. + [allocation] : The total amount of tokens to be allocated for the IRO. + [duration] : The duration of the IRO plan in seconds. Required Flags: --curve : The bonding curve parameters in the format "M,N,C" where the curve is defined as p(x) = M * x^N + C. @@ -37,29 +37,24 @@ Optional Flags: --incentives-epochs: The number of epochs over which incentives will be distributed. (1 minute epoch) Examples: - dymd tx iro create-iro myrollapp1 1000000000 1630000000 --curve "1.2,0.4,0" --from mykey - dymd tx iro create-iro myrollapp2 500000000 "2023-09-15T14:00:00Z" --curve "1.5,0.5,100" --start-time "2023-10-01T00:00:00Z" --incentives-start 24h --incentives-epochs 3000 --from mykey + dymd tx iro create-iro myrollapp1 1000000000 24h --curve "1.2,0.4,0" --from mykey + dymd tx iro create-iro myrollapp2 500000000 30m --curve "1.5,0.5,100" --start-time "2023-10-01T00:00:00Z" --incentives-start 24h --incentives-epochs 3000 --from mykey `, Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) (err error) { argRollappId := args[0] argAllocation := args[1] - argPreLaunchTimeStr := args[2] + argDurationStr := args[2] allocationAmt, ok := math.NewIntFromString(argAllocation) if !ok { return fmt.Errorf("invalid allocation amount: %s", argAllocation) } - var preLaunchTime time.Time - if argPreLaunchTimeStr == "" { - return errors.New("pre-launch time cannot be empty") - } else if timeUnix, err := strconv.ParseInt(argPreLaunchTimeStr, 10, 64); err == nil { // unix time - preLaunchTime = time.Unix(timeUnix, 0) - } else if timeRFC, err := time.Parse(time.RFC3339, argPreLaunchTimeStr); err == nil { // RFC time - preLaunchTime = timeRFC - } else { // invalid input - return errors.New("invalid start time format") + // Parse the string into a time.Duration + planDuration, err := time.ParseDuration(argDurationStr) + if err != nil { + return err } // Parse curve flag @@ -109,7 +104,7 @@ Examples: AllocatedAmount: allocationAmt, BondingCurve: curve, StartTime: startTime, - PreLaunchTime: preLaunchTime, + IroPlanDuration: planDuration, IncentivePlanParams: types.IncentivePlanParams{ StartTimeAfterSettlement: incentivesStart, NumEpochsPaidOver: incentivesEpochs, diff --git a/x/iro/keeper/create_plan.go b/x/iro/keeper/create_plan.go index 999bf86fb..5a92102bd 100644 --- a/x/iro/keeper/create_plan.go +++ b/x/iro/keeper/create_plan.go @@ -45,9 +45,10 @@ func (m msgServer) CreatePlan(goCtx context.Context, req *types.MsgCreatePlan) ( startTime = ctx.BlockTime() } // check minimal duration - if startTime.Add(m.Keeper.GetParams(ctx).MinPlanDuration).After(req.PreLaunchTime) { + if req.IroPlanDuration < m.Keeper.GetParams(ctx).MinPlanDuration { return nil, errors.Join(gerrc.ErrFailedPrecondition, types.ErrInvalidEndTime) } + preLaunchTime := startTime.Add(req.IroPlanDuration) // validate incentive plan params params := m.Keeper.GetParams(ctx) @@ -64,7 +65,7 @@ func (m msgServer) CreatePlan(goCtx context.Context, req *types.MsgCreatePlan) ( return nil, errors.Join(gerrc.ErrFailedPrecondition, types.ErrPlanExists) } - planId, err := m.Keeper.CreatePlan(ctx, req.AllocatedAmount, startTime, req.PreLaunchTime, rollapp, req.BondingCurve, req.IncentivePlanParams) + planId, err := m.Keeper.CreatePlan(ctx, req.AllocatedAmount, startTime, preLaunchTime, rollapp, req.BondingCurve, req.IncentivePlanParams) if err != nil { return nil, err } diff --git a/x/iro/types/msgs.go b/x/iro/types/msgs.go index 3d729e9cd..86a0d7c95 100644 --- a/x/iro/types/msgs.go +++ b/x/iro/types/msgs.go @@ -2,6 +2,7 @@ package types import ( "errors" + "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" sdk "github.com/cosmos/cosmos-sdk/types" @@ -38,7 +39,7 @@ func (m *MsgCreatePlan) ValidateBasic() error { return ErrInvalidAllocation } - if m.PreLaunchTime.Before(m.StartTime) { + if m.IroPlanDuration < 0 { return ErrInvalidEndTime } diff --git a/x/iro/types/params.go b/x/iro/types/params.go index a35b6e666..0a0fb0dd9 100644 --- a/x/iro/types/params.go +++ b/x/iro/types/params.go @@ -12,7 +12,7 @@ import ( var ( DefaultTakerFee = "0.02" // 2% DefaultCreationFee = math.NewInt(10).MulRaw(1e18) /* 10 DYM */ - DefaultMinPlanDuration = 7 * 24 * time.Hour // 7 days + DefaultMinPlanDuration = 0 * time.Hour // no enforced minimum by default DefaultIncentivePlanMinimumNumEpochsPaidOver = uint64(10_080) // default: min 7 days (based on 1 minute distribution epoch) DefaultIncentivePlanMinimumStartTimeAfterSettlement = 60 * time.Minute // default: min 1 hour after settlement ) diff --git a/x/iro/types/tx.pb.go b/x/iro/types/tx.pb.go index 365e9093b..f1fc8cbfa 100644 --- a/x/iro/types/tx.pb.go +++ b/x/iro/types/tx.pb.go @@ -17,6 +17,7 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -138,8 +139,8 @@ type MsgCreatePlan struct { BondingCurve BondingCurve `protobuf:"bytes,4,opt,name=bonding_curve,json=bondingCurve,proto3" json:"bonding_curve"` // The start time of the plan. StartTime time.Time `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` - // The time before which the rollapp cannot be started. - PreLaunchTime time.Time `protobuf:"bytes,6,opt,name=pre_launch_time,json=preLaunchTime,proto3,stdtime" json:"pre_launch_time"` + // The duration of the plan. + IroPlanDuration time.Duration `protobuf:"bytes,6,opt,name=iro_plan_duration,json=iroPlanDuration,proto3,stdduration" json:"iro_plan_duration"` // The incentive plan parameters for the tokens left after the plan is settled. IncentivePlanParams IncentivePlanParams `protobuf:"bytes,7,opt,name=incentive_plan_params,json=incentivePlanParams,proto3" json:"incentive_plan_params"` } @@ -205,11 +206,11 @@ func (m *MsgCreatePlan) GetStartTime() time.Time { return time.Time{} } -func (m *MsgCreatePlan) GetPreLaunchTime() time.Time { +func (m *MsgCreatePlan) GetIroPlanDuration() time.Duration { if m != nil { - return m.PreLaunchTime + return m.IroPlanDuration } - return time.Time{} + return 0 } func (m *MsgCreatePlan) GetIncentivePlanParams() IncentivePlanParams { @@ -560,61 +561,62 @@ func init() { } var fileDescriptor_41b9ae3e091bbd60 = []byte{ - // 862 bytes of a gzipped FileDescriptorProto + // 880 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0x8e, 0x93, 0xcd, 0xa6, 0xfb, 0x9a, 0x74, 0xd3, 0xa1, 0x55, 0xb6, 0x96, 0xd8, 0x54, 0x6e, - 0x85, 0x42, 0x4a, 0xed, 0xfc, 0x90, 0x38, 0xe4, 0xd6, 0x8d, 0x04, 0x5a, 0xd4, 0x95, 0xd0, 0x86, - 0x22, 0x28, 0x07, 0x6b, 0xd6, 0x1e, 0x9c, 0x01, 0x7b, 0xc6, 0xf2, 0x8c, 0x37, 0xbb, 0x9c, 0x10, - 0x12, 0xf7, 0x1e, 0x39, 0xf3, 0x17, 0xf4, 0xc0, 0x1f, 0xd1, 0x63, 0xc5, 0x09, 0x71, 0x28, 0x28, - 0x39, 0xf4, 0x5f, 0xe0, 0x82, 0x84, 0x66, 0xc6, 0x76, 0x36, 0x45, 0xd9, 0xdd, 0x12, 0x71, 0xb2, - 0x9f, 0xdf, 0xf7, 0xbe, 0x79, 0xf3, 0xcd, 0x37, 0x4f, 0x86, 0x7b, 0xe1, 0x38, 0x21,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, 0x2c, 0xf3, 0x16, + 0x7d, 0x35, 0x74, 0x00, 0xca, 0x3c, 0x66, 0x6f, 0x9d, 0x1d, 0xb8, 0x75, 0xce, 0x1c, 0xa5, 0x6d, + 0xd0, 0x3a, 0x2c, 0xe9, 0x2e, 0x68, 0x68, 0x6c, 0xd2, 0xaf, 0xab, 0x65, 0x37, 0x74, 0xfe, 0xb1, + 0xa0, 0xde, 0x13, 0x51, 0x27, 0x1f, 0x2b, 0x23, 0x0d, 0xf2, 0xf1, 0x2c, 0x46, 0xd2, 0xb0, 0x49, + 0xce, 0xf9, 0x49, 0x4e, 0xf4, 0x21, 0xd4, 0x5f, 0xcb, 0x38, 0x45, 0x36, 0xfa, 0x1c, 0x9a, 0x09, + 0x1e, 0xf9, 0x01, 0x17, 0xb2, 0x74, 0x62, 0xed, 0x7f, 0x11, 0xae, 0x24, 0x78, 0x74, 0xc8, 0x85, + 0x34, 0x3e, 0x2c, 0x14, 0xd3, 0x43, 0x38, 0xab, 0x70, 0xc3, 0x8c, 0x5f, 0x9d, 0xb0, 0x1f, 0xe7, + 0x61, 0xa9, 0x27, 0xa2, 0x23, 0x12, 0xc7, 0x68, 0x07, 0xea, 0x82, 0xc4, 0xf1, 0x0c, 0x9a, 0x14, + 0xb8, 0x37, 0x2f, 0xca, 0x23, 0x58, 0x4b, 0x28, 0xf3, 0x29, 0x0b, 0x78, 0x42, 0x5e, 0x4f, 0x96, + 0x66, 0x42, 0x59, 0x57, 0xf3, 0x14, 0xc2, 0x5c, 0x57, 0xc2, 0x14, 0x93, 0x38, 0x6b, 0xfa, 0xa2, + 0x54, 0x32, 0x54, 0xd2, 0x10, 0xb8, 0xa6, 0xec, 0x15, 0x63, 0x9a, 0xa0, 0x3d, 0x58, 0x0a, 0xd4, + 0xcb, 0x0c, 0xda, 0x94, 0xc0, 0x4b, 0xc5, 0x39, 0x58, 0x56, 0x85, 0x4b, 0x98, 0x83, 0x60, 0xb5, + 0x2c, 0x53, 0x96, 0xde, 0xfb, 0x7b, 0x01, 0x16, 0x7a, 0x22, 0x42, 0x29, 0x2c, 0x9f, 0xbb, 0xbb, + 0xef, 0x5d, 0x75, 0x92, 0x2e, 0x5c, 0xa2, 0xf6, 0xfe, 0x7f, 0x00, 0x57, 0x47, 0xe7, 0x1b, 0x80, + 0x89, 0xdb, 0xf6, 0xdd, 0x29, 0x14, 0x67, 0x50, 0x7b, 0x77, 0x66, 0x68, 0x55, 0xeb, 0x21, 0x2c, + 0xa8, 0x93, 0xe8, 0x4c, 0xc9, 0xec, 0xe4, 0x63, 0x7b, 0x7b, 0x3a, 0xa6, 0xa2, 0xfd, 0x02, 0x6a, + 0xda, 0xce, 0x77, 0xa6, 0xe4, 0x28, 0x90, 0x7d, 0x6f, 0x06, 0x50, 0xc5, 0xfc, 0x15, 0x2c, 0x1a, + 0x3b, 0xdc, 0x9d, 0x36, 0xac, 0x42, 0xd9, 0xef, 0xcd, 0x82, 0x2a, 0xc9, 0xed, 0xc5, 0xef, 0x5f, + 0x3e, 0xdd, 0xb6, 0x3a, 0x1f, 0x3f, 0x3b, 0x69, 0x5b, 0xcf, 0x4f, 0xda, 0xd6, 0x5f, 0x27, 0x6d, + 0xeb, 0xc9, 0x69, 0x7b, 0xee, 0xf9, 0x69, 0x7b, 0xee, 0xf7, 0xd3, 0xf6, 0xdc, 0xa3, 0x9d, 0x09, + 0xa3, 0x5f, 0xf2, 0x7b, 0x31, 0xdc, 0xf7, 0x46, 0xe6, 0x77, 0x47, 0xd9, 0x7e, 0x50, 0xd7, 0xb7, + 0xf8, 0xfe, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xda, 0xd9, 0x63, 0x1d, 0x19, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -944,7 +946,7 @@ func (m *MsgCreatePlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x3a - n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.PreLaunchTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreLaunchTime):]) + n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.IroPlanDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.IroPlanDuration):]) if err3 != nil { return 0, err3 } @@ -1302,7 +1304,7 @@ func (m *MsgCreatePlan) Size() (n int) { n += 1 + l + sovTx(uint64(l)) l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime) n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreLaunchTime) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.IroPlanDuration) n += 1 + l + sovTx(uint64(l)) l = m.IncentivePlanParams.Size() n += 1 + l + sovTx(uint64(l)) @@ -1774,7 +1776,7 @@ func (m *MsgCreatePlan) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PreLaunchTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IroPlanDuration", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1801,7 +1803,7 @@ func (m *MsgCreatePlan) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.PreLaunchTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.IroPlanDuration, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/rollapp/keeper/rollapp.go b/x/rollapp/keeper/rollapp.go index 9c20bae31..ef88cd749 100644 --- a/x/rollapp/keeper/rollapp.go +++ b/x/rollapp/keeper/rollapp.go @@ -152,7 +152,7 @@ func (k Keeper) SetIROPlanToRollapp(ctx sdk.Context, rollapp *types.Rollapp, pre return errorsmod.Wrap(gerrc.ErrFailedPrecondition, "genesis info not set") } rollapp.GenesisInfo.Sealed = true - rollapp.PreLaunchTime = preLaunchTime + rollapp.PreLaunchTime = &preLaunchTime rollapp.GenesisState.TransfersEnabled = false k.SetRollapp(ctx, *rollapp) return nil diff --git a/x/rollapp/types/rollapp.pb.go b/x/rollapp/types/rollapp.pb.go index d7d204b79..a317acab6 100644 --- a/x/rollapp/types/rollapp.pb.go +++ b/x/rollapp/types/rollapp.pb.go @@ -145,7 +145,7 @@ type Rollapp struct { // pre_launch_time is the timestamp indicating the time before which the // rollapp cannot be started. // Set when creating IRO plan for the rollapp - PreLaunchTime time.Time `protobuf:"bytes,16,opt,name=pre_launch_time,json=preLaunchTime,proto3,stdtime" json:"pre_launch_time"` + PreLaunchTime *time.Time `protobuf:"bytes,16,opt,name=pre_launch_time,json=preLaunchTime,proto3,stdtime" json:"pre_launch_time,omitempty"` // LivenessEventHeight is the height of an upcoming liveness event (slash or // jail) 0 means not set LivenessEventHeight int64 `protobuf:"varint,17,opt,name=liveness_event_height,json=livenessEventHeight,proto3" json:"liveness_event_height,omitempty"` @@ -264,11 +264,11 @@ func (m *Rollapp) GetLaunched() bool { return false } -func (m *Rollapp) GetPreLaunchTime() time.Time { +func (m *Rollapp) GetPreLaunchTime() *time.Time { if m != nil { return m.PreLaunchTime } - return time.Time{} + return nil } func (m *Rollapp) GetLivenessEventHeight() int64 { @@ -453,62 +453,62 @@ func init() { } var fileDescriptor_d4ef2bec3aea5528 = []byte{ - // 876 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x16, 0x25, 0x59, 0x3f, 0x2b, 0xc9, 0x66, 0x36, 0x71, 0xcb, 0x0a, 0x8d, 0x2c, 0xa8, 0x40, - 0xa1, 0x36, 0x31, 0x89, 0xda, 0x01, 0x7a, 0xae, 0x5b, 0x37, 0x51, 0x1a, 0x17, 0x05, 0x65, 0xbb, - 0x40, 0x0e, 0x25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, 0xfc, 0x10, 0xd5, 0x17, 0x89, 0xc7, 0x97, 0x19, 0x58, 0xdb, 0x7d, 0x63, 0xb8, 0x7d, 0x60, - 0xbf, 0x63, 0x39, 0xf6, 0xf9, 0xc9, 0xe9, 0x32, 0x03, 0xb7, 0xb6, 0x48, 0xc4, 0x89, 0xbb, 0xa8, - 0x11, 0xfb, 0x73, 0x1a, 0xcc, 0x20, 0xb4, 0x76, 0x64, 0x7b, 0x57, 0x32, 0x7e, 0x82, 0x76, 0xb2, - 0x1c, 0x3c, 0x25, 0x7b, 0x62, 0x33, 0x2c, 0x53, 0x96, 0xda, 0xb5, 0xd5, 0xda, 0xd8, 0xc5, 0xda, - 0xd8, 0xa7, 0xc5, 0xda, 0x1c, 0x35, 0x44, 0x65, 0xcf, 0xff, 0xda, 0x33, 0xdc, 0x4e, 0x96, 0xc3, - 0x13, 0xe9, 0x2b, 0x50, 0x7c, 0x80, 0x76, 0x63, 0xb2, 0x10, 0x05, 0x33, 0x0f, 0x16, 0x40, 0xb9, - 0x37, 0x03, 0x12, 0xcd, 0xb8, 0x75, 0xab, 0x6f, 0x0c, 0x2b, 0xee, 0xed, 0x02, 0x3c, 0x16, 0xd8, - 0x23, 0x09, 0xe1, 0x2f, 0x91, 0x15, 0xfb, 0x8c, 0x2b, 0xda, 0x79, 0xf3, 0x2c, 0x14, 0x87, 0x76, - 0xc3, 0xd2, 0x6d, 0x57, 0xe0, 0x92, 0x46, 0x67, 0x12, 0x55, 0x8e, 0x83, 0xfb, 0xa8, 0xa6, 0x0a, - 0xc5, 0x3b, 0xa8, 0x75, 0x46, 0x59, 0x06, 0x01, 0x99, 0x12, 0x08, 0xcd, 0x12, 0xae, 0xa3, 0xca, - 0xf1, 0xf9, 0x89, 0x69, 0xe0, 0x06, 0xaa, 0xfe, 0xf8, 0xd5, 0xf8, 0xc4, 0x2c, 0x3f, 0xae, 0x36, - 0x2a, 0x66, 0x7d, 0xf0, 0x6b, 0x19, 0xb5, 0xd6, 0x66, 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 0x84, 0x6b, - 0x97, 0x54, 0xde, 0xeb, 0x92, 0xb7, 0x07, 0xc4, 0x03, 0xd4, 0x56, 0xa0, 0x62, 0x99, 0xec, 0x73, - 0xd5, 0xfd, 0x97, 0x0e, 0x3f, 0x40, 0xbb, 0xff, 0x09, 0xa0, 0x8d, 0xb7, 0xa4, 0xf1, 0x9b, 0xc1, - 0xa3, 0xef, 0x5f, 0x5c, 0xf5, 0x8c, 0x97, 0x57, 0x3d, 0xe3, 0xef, 0xab, 0x9e, 0xf1, 0xfc, 0xba, - 0x57, 0x7a, 0x79, 0xdd, 0x2b, 0xfd, 0x71, 0xdd, 0x2b, 0x3d, 0x7d, 0xb0, 0x36, 0xbd, 0xb7, 0xfc, - 0x41, 0x16, 0x87, 0xce, 0xc5, 0xea, 0x37, 0x22, 0xe7, 0x39, 0xa9, 0xc9, 0xcd, 0x3c, 0xfc, 0x27, - 0x00, 0x00, 0xff, 0xff, 0x7e, 0xf7, 0xb0, 0x5e, 0x44, 0x07, 0x00, 0x00, + // 875 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x5f, 0x6f, 0xdb, 0x54, + 0x14, 0x8f, 0x93, 0x34, 0x7f, 0x6e, 0x92, 0xd6, 0xbb, 0x5b, 0xc1, 0x44, 0x2c, 0x8d, 0x82, 0x84, + 0x02, 0x5b, 0x6d, 0xd1, 0x4e, 0xe2, 0x99, 0x42, 0x59, 0x33, 0x28, 0x42, 0x4e, 0x5b, 0xa4, 0x3d, + 0x60, 0x39, 0xf6, 0x89, 0x73, 0x35, 0xfb, 0xda, 0xf8, 0xde, 0x84, 0xa6, 0x9f, 0x62, 0x5f, 0x01, + 0x89, 0x0f, 0xb3, 0xc7, 0x89, 0x27, 0xc4, 0xc3, 0x40, 0xed, 0x17, 0x41, 0xf7, 0x8f, 0xb3, 0x40, + 0x37, 0x32, 0xf1, 0x74, 0x7d, 0x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, 0x7e, 0x33, 0x78, 0xf4, + 0xdd, 0x8b, 0xeb, 0x9e, 0xf1, 0xf2, 0xba, 0x67, 0xfc, 0x75, 0xdd, 0x33, 0x9e, 0xdf, 0xf4, 0x4a, + 0x2f, 0x6f, 0x7a, 0xa5, 0xdf, 0x6f, 0x7a, 0xa5, 0xa7, 0x8f, 0xd6, 0xa6, 0xf7, 0x96, 0xbf, 0xc7, + 0xe2, 0xd0, 0xb9, 0x5c, 0xfd, 0x42, 0xe4, 0x3c, 0x27, 0x35, 0xb9, 0x95, 0x87, 0x7f, 0x07, 0x00, + 0x00, 0xff, 0xff, 0x8c, 0x2c, 0xe9, 0x55, 0x40, 0x07, 0x00, 0x00, } func (m *RollappGenesisState) Marshal() (dAtA []byte, err error) { @@ -578,16 +578,18 @@ func (m *Rollapp) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x88 } - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.PreLaunchTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreLaunchTime):]) - if err1 != nil { - return 0, err1 + if m.PreLaunchTime != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.PreLaunchTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.PreLaunchTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintRollapp(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 } - i -= n1 - i = encodeVarintRollapp(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 if m.Launched { i-- if m.Launched { @@ -884,8 +886,10 @@ func (m *Rollapp) Size() (n int) { if m.Launched { n += 2 } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PreLaunchTime) - n += 2 + l + sovRollapp(uint64(l)) + if m.PreLaunchTime != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.PreLaunchTime) + n += 2 + l + sovRollapp(uint64(l)) + } if m.LivenessEventHeight != 0 { n += 2 + sovRollapp(uint64(m.LivenessEventHeight)) } @@ -1401,7 +1405,10 @@ func (m *Rollapp) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.PreLaunchTime, dAtA[iNdEx:postIndex]); err != nil { + if m.PreLaunchTime == nil { + m.PreLaunchTime = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.PreLaunchTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/sequencer/keeper/msg_server_create_sequencer.go b/x/sequencer/keeper/msg_server_create_sequencer.go index 4b6ae7184..8a5b853dc 100644 --- a/x/sequencer/keeper/msg_server_create_sequencer.go +++ b/x/sequencer/keeper/msg_server_create_sequencer.go @@ -54,7 +54,7 @@ func (k msgServer) CreateSequencer(goCtx context.Context, msg *types.MsgCreateSe // check pre launch time. // skipped if no pre launch time is set - if rollapp.PreLaunchTime.After(ctx.BlockTime()) { + if rollapp.PreLaunchTime != nil && rollapp.PreLaunchTime.After(ctx.BlockTime()) { return nil, types.ErrBeforePreLaunchTime } diff --git a/x/sequencer/keeper/msg_server_create_sequencer_test.go b/x/sequencer/keeper/msg_server_create_sequencer_test.go index 4c35460bb..96f070c71 100644 --- a/x/sequencer/keeper/msg_server_create_sequencer_test.go +++ b/x/sequencer/keeper/msg_server_create_sequencer_test.go @@ -426,7 +426,7 @@ func (suite *SequencerTestSuite) TestCreateSequencerBeforePrelaunch() { // set prelaunch time to the rollapp preLaunchTime := time.Now() rollapp := suite.App.RollappKeeper.MustGetRollapp(suite.Ctx, rollappId) - rollapp.PreLaunchTime = preLaunchTime + rollapp.PreLaunchTime = &preLaunchTime suite.App.RollappKeeper.SetRollapp(suite.Ctx, rollapp) addr := sdk.AccAddress(pk.Address())