diff --git a/proto/shentu/bounty/v1/bounty.proto b/proto/shentu/bounty/v1/bounty.proto index 590d191d8..8d6ead100 100644 --- a/proto/shentu/bounty/v1/bounty.proto +++ b/proto/shentu/bounty/v1/bounty.proto @@ -32,12 +32,13 @@ message Finding { string title = 3; // JSON by FindingDetail string description = 4 [(gogoproto.moretags) = "yaml:\"description\""]; - string submitter_address = 5 [(gogoproto.moretags) = "yaml:\"submitter_address\""]; - google.protobuf.Timestamp create_time = 6 + // hash(desc + pos + submitter) + string finding_hash = 5 [(gogoproto.moretags) = "yaml:\"finding_hash\""]; + string submitter_address = 6 [(gogoproto.moretags) = "yaml:\"submitter_address\""]; + SeverityLevel severity_level = 7 [(gogoproto.moretags) = "yaml:\"severity_level\""]; + FindingStatus status = 8 [(gogoproto.moretags) = "yaml:\"status\""]; + google.protobuf.Timestamp create_time = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"create_time\""]; - FindingStatus status = 7 [(gogoproto.moretags) = "yaml:\"status\""]; - string finding_hash = 8 [(gogoproto.moretags) = "yaml:\"finding_hash\""]; - SeverityLevel severity_level = 9 [(gogoproto.moretags) = "yaml:\"severity_level\""]; } enum ProgramStatus { @@ -51,22 +52,22 @@ enum ProgramStatus { enum SeverityLevel { option (gogoproto.goproto_enum_prefix) = false; - SEVERITY_LEVEL_CRITICAL = 0 [(gogoproto.enumvalue_customname) = "SeverityLevelCritical"]; - SEVERITY_LEVEL_HIGH = 1 [(gogoproto.enumvalue_customname) = "SeverityLevelHigh"]; - SEVERITY_LEVEL_MEDIUM = 2 [(gogoproto.enumvalue_customname) = "SeverityLevelMedium"]; - SEVERITY_LEVEL_LOW = 3 [(gogoproto.enumvalue_customname) = "SeverityLevelLow"]; - SEVERITY_LEVEL_INFORMATIONAL = 4 [(gogoproto.enumvalue_customname) = "SeverityLevelInformational"]; + SEVERITY_LEVEL_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; + SEVERITY_LEVEL_CRITICAL = 1 [(gogoproto.enumvalue_customname) = "Critical"]; + SEVERITY_LEVEL_HIGH = 2 [(gogoproto.enumvalue_customname) = "High"]; + SEVERITY_LEVEL_MEDIUM = 3 [(gogoproto.enumvalue_customname) = "Medium"]; + SEVERITY_LEVEL_LOW = 4 [(gogoproto.enumvalue_customname) = "Low"]; + SEVERITY_LEVEL_INFORMATIONAL = 5 [(gogoproto.enumvalue_customname) = "Informational"]; } enum FindingStatus { option (gogoproto.goproto_enum_prefix) = false; - FINDING_STATUS_REPORTED = 0 [(gogoproto.enumvalue_customname) = "FindingStatusReported"]; - FINDING_STATUS_PROPOSED = 1 [(gogoproto.enumvalue_customname) = "FindingStatusProposed"]; - FINDING_STATUS_ACTIVE = 2 [(gogoproto.enumvalue_customname) = "FindingStatusActive"]; - FINDING_STATUS_CONFIRMED = 3 [(gogoproto.enumvalue_customname) = "FindingStatusConfirmed"]; - FINDING_STATUS_PAID = 4 [(gogoproto.enumvalue_customname) = "FindingStatusPaid"]; - FINDING_STATUS_CLOSED = 5 [(gogoproto.enumvalue_customname) = "FindingStatusClosed"]; + FINDING_STATUS_SUBMITTED = 0 [(gogoproto.enumvalue_customname) = "FindingStatusSubmitted"]; + FINDING_STATUS_ACTIVE = 1 [(gogoproto.enumvalue_customname) = "FindingStatusActive"]; + FINDING_STATUS_CONFIRMED = 2 [(gogoproto.enumvalue_customname) = "FindingStatusConfirmed"]; + FINDING_STATUS_PAID = 3 [(gogoproto.enumvalue_customname) = "FindingStatusPaid"]; + FINDING_STATUS_CLOSED = 4 [(gogoproto.enumvalue_customname) = "FindingStatusClosed"]; } message BountyLevel { @@ -87,7 +88,6 @@ message BountyLevel { // string description = 1; // string scope_rules = 2; // string known_issues = 3; -// repeated BountyLevel bounty_levels = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"bounty_levels\""]; //} //// FindingDetail defines a finding detail. @@ -99,5 +99,4 @@ message BountyLevel { // string proof_of_concept = 2 [(gogoproto.moretags) = "yaml:\"proof_of_concept\""]; // repeated string program_targets = 3 [(gogoproto.moretags) = "yaml:\"program_targets\""]; // repeated string attachments = 4; -// SeverityLevel severity_level = 5 [(gogoproto.moretags) = "yaml:\"severity_level\""]; //} \ No newline at end of file diff --git a/proto/shentu/bounty/v1/tx.proto b/proto/shentu/bounty/v1/tx.proto index 01a3cddea..6329bedb7 100644 --- a/proto/shentu/bounty/v1/tx.proto +++ b/proto/shentu/bounty/v1/tx.proto @@ -28,6 +28,9 @@ service Msg { // SubmitFinding defines a method for submitting a new finding. rpc SubmitFinding(MsgSubmitFinding) returns (MsgSubmitFindingResponse); + // EditFinding defines a method for editing a new finding. + rpc EditFinding(MsgEditFinding) returns (MsgEditFindingResponse); + // AcceptFinding defines a method for host accept a finding. rpc AcceptFinding(MsgAcceptFinding) returns (MsgAcceptFindingResponse); @@ -103,13 +106,30 @@ message MsgSubmitFinding { string finding_id = 2 [(gogoproto.moretags) = "yaml:\"finding_id\""]; string title = 3; string description = 4; - string submitter_address = 5 [(gogoproto.moretags) = "yaml:\"submitter_address\""]; - SeverityLevel severity_level = 6 [(gogoproto.moretags) = "yaml:\"severity_level\""]; + string finding_hash = 5 [(gogoproto.moretags) = "yaml:\"finding_hash\""]; + string submitter_address = 6 [(gogoproto.moretags) = "yaml:\"submitter_address\""]; + SeverityLevel severity_level = 7 [(gogoproto.moretags) = "yaml:\"severity_level\""]; } // MsgSubmitFindingResponse defines the MsgSubmitFinding response type. message MsgSubmitFindingResponse {} +// MsgEditFinding defines a message to edit a finding. +message MsgEditFinding { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string program_id = 1 [(gogoproto.moretags) = "yaml:\"program_id\""]; + string finding_id = 2 [(gogoproto.moretags) = "yaml:\"finding_id\""]; + string title = 3; + string description = 4; + string submitter_address = 5 [(gogoproto.moretags) = "yaml:\"submitter_address\""]; + SeverityLevel severity_level = 6 [(gogoproto.moretags) = "yaml:\"severity_level\""]; +} + +// MsgEditFindingResponse defines the MsgEditFinding response type. +message MsgEditFindingResponse {} + // MsgAcceptFinding defines a message to accept a finding to an existing finding. message MsgAcceptFinding { option (gogoproto.equal) = false; diff --git a/x/bounty/client/cli/tx.go b/x/bounty/client/cli/tx.go index 8206a85bd..5f73e0a93 100644 --- a/x/bounty/client/cli/tx.go +++ b/x/bounty/client/cli/tx.go @@ -27,6 +27,7 @@ func NewTxCmd() *cobra.Command { NewOpenProgramCmd(), NewCloseProgramCmd(), NewSubmitFindingCmd(), + NewEditFindingCmd(), NewAcceptFindingCmd(), NewRejectFindingCmd(), NewCloseFindingCmd(), @@ -223,6 +224,62 @@ func NewSubmitFindingCmd() *cobra.Command { _ = cmd.MarkFlagRequired(flags.FlagFrom) _ = cmd.MarkFlagRequired(FlagProgramID) + _ = cmd.MarkFlagRequired(FlagFindingID) + + return cmd +} + +func NewEditFindingCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "edit-finding", + Short: "edit finding for a program", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + submitAddr := clientCtx.GetFromAddress() + + pid, err := cmd.Flags().GetString(FlagProgramID) + if err != nil { + return err + } + fid, err := cmd.Flags().GetString(FlagFindingID) + if err != nil { + return err + } + title, err := cmd.Flags().GetString(FlagFindingTitle) + if err != nil { + return err + } + desc, err := cmd.Flags().GetString(FlagDesc) + if err != nil { + return err + } + severityLevel, err := cmd.Flags().GetInt32(FlagFindingSeverityLevel) + if err != nil { + return err + } + //_, ok := types.SeverityLevel_name[severityLevel] + //if !ok { + // return fmt.Errorf("invalid %s value", FlagFindingSeverityLevel) + //} + + msg := types.NewMsgEditFinding(pid, fid, title, desc, submitAddr, types.SeverityLevel(severityLevel)) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(FlagProgramID, "", "The program's ID") + cmd.Flags().String(FlagFindingID, "", "The finding's ID") + cmd.Flags().String(FlagFindingTitle, "", "The finding's title") + cmd.Flags().String(FlagDesc, "", "The finding's description") + cmd.Flags().Int32(FlagFindingSeverityLevel, 8, "The finding's severity level") + flags.AddTxFlagsToCmd(cmd) + + _ = cmd.MarkFlagRequired(flags.FlagFrom) + _ = cmd.MarkFlagRequired(FlagProgramID) + _ = cmd.MarkFlagRequired(FlagFindingID) return cmd } diff --git a/x/bounty/handler.go b/x/bounty/handler.go index 05c162093..6d1d5ac0e 100644 --- a/x/bounty/handler.go +++ b/x/bounty/handler.go @@ -30,6 +30,9 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgSubmitFinding: res, err := msgServer.SubmitFinding(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgEditFinding: + res, err := msgServer.EditFinding(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgAcceptFinding: res, err := msgServer.AcceptFinding(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) diff --git a/x/bounty/keeper/finding_test.go b/x/bounty/keeper/finding_test.go index 238f660bc..0971e88b9 100644 --- a/x/bounty/keeper/finding_test.go +++ b/x/bounty/keeper/finding_test.go @@ -42,9 +42,9 @@ func (suite *KeeperTestSuite) TestSetGetFinding() { Description: "desc", SubmitterAddress: suite.address[0].String(), CreateTime: time.Time{}, - Status: types.FindingStatusReported, + Status: types.FindingStatusSubmitted, FindingHash: "", - SeverityLevel: types.SeverityLevelLow, + SeverityLevel: types.Low, }, }, }, diff --git a/x/bounty/keeper/msg_server.go b/x/bounty/keeper/msg_server.go index 0072378f4..027df9c38 100644 --- a/x/bounty/keeper/msg_server.go +++ b/x/bounty/keeper/msg_server.go @@ -107,11 +107,6 @@ func (k msgServer) EditProgram(goCtx context.Context, msg *types.MsgEditProgram) func (k msgServer) OpenProgram(goCtx context.Context, msg *types.MsgOpenProgram) (*types.MsgOpenProgramResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - _, found := k.GetProgram(ctx, msg.ProgramId) - if !found { - return nil, types.ErrNoProgramFound - } - operatorAddr, err := sdk.AccAddressFromBech32(msg.OperatorAddress) if err != nil { return nil, err @@ -148,7 +143,7 @@ func (k msgServer) CloseProgram(goCtx context.Context, msg *types.MsgCloseProgra } ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( - types.EventTypeOpenProgram, + types.EventTypeCloseProgram, sdk.NewAttribute(types.AttributeKeyProgramID, msg.ProgramId), ), sdk.NewEvent( @@ -183,7 +178,7 @@ func (k msgServer) SubmitFinding(goCtx context.Context, msg *types.MsgSubmitFind return nil, types.ErrFindingAlreadyExists } - finding, err := types.NewFinding(msg.ProgramId, msg.FindingId, msg.Title, msg.Description, operatorAddr, submitTime, msg.SeverityLevel) + finding, err := types.NewFinding(msg.ProgramId, msg.FindingId, msg.Title, msg.Description, msg.FindingHash, operatorAddr, submitTime, msg.SeverityLevel) if err != nil { return nil, err } @@ -210,6 +205,53 @@ func (k msgServer) SubmitFinding(goCtx context.Context, msg *types.MsgSubmitFind return &types.MsgSubmitFindingResponse{}, nil } +func (k msgServer) EditFinding(goCtx context.Context, msg *types.MsgEditFinding) (*types.MsgEditFindingResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + program, isExist := k.GetProgram(ctx, msg.ProgramId) + if !isExist { + return nil, types.ErrProgramNotExists + } + if program.Status != types.ProgramStatusActive { + return nil, types.ErrProgramNotActive + } + + finding, found := k.GetFinding(ctx, msg.FindingId) + if !found { + return nil, types.ErrFindingNotExists + } + // check submitter + if finding.SubmitterAddress != msg.SubmitterAddress { + return nil, types.ErrFindingSubmitterInvalid + } + if len(msg.Title) > 0 { + finding.Title = msg.Title + } + if len(msg.Description) > 0 { + finding.Description = msg.Description + } + if msg.SeverityLevel != types.Unspecified { + finding.SeverityLevel = msg.SeverityLevel + } + + k.SetFinding(ctx, finding) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeEditFinding, + sdk.NewAttribute(types.AttributeKeyFindingID, finding.FindingId), + sdk.NewAttribute(types.AttributeKeyProgramID, finding.ProgramId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.SubmitterAddress), + ), + }) + + return &types.MsgEditFindingResponse{}, nil +} + func (k msgServer) AcceptFinding(goCtx context.Context, msg *types.MsgAcceptFinding) (*types.MsgAcceptFindingResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -303,12 +345,12 @@ func (k msgServer) CloseFinding(goCtx context.Context, msg *types.MsgCloseFindin } // check submitter - if finding.SubmitterAddress != msg.OperatorAddress || !k.certKeeper.IsCertifier(ctx, operatorAddr) { + if finding.SubmitterAddress != msg.OperatorAddress && !k.certKeeper.IsCertifier(ctx, operatorAddr) { return nil, types.ErrFindingSubmitterInvalid } // check status - if finding.Status != types.FindingStatusReported { + if finding.Status != types.FindingStatusSubmitted { return nil, types.ErrFindingStatusInvalid } @@ -317,7 +359,7 @@ func (k msgServer) CloseFinding(goCtx context.Context, msg *types.MsgCloseFindin ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( - types.EventTypeCancelFinding, + types.EventTypeCloseFinding, sdk.NewAttribute(types.AttributeKeyFindingID, msg.FindingId), sdk.NewAttribute(types.AttributeKeyProgramID, finding.ProgramId), ), @@ -352,6 +394,7 @@ func (k msgServer) ReleaseFinding(goCtx context.Context, msg *types.MsgReleaseFi return nil, types.ErrProgramCreatorInvalid } + finding.Description = msg.Description k.SetFinding(ctx, finding) ctx.EventManager().EmitEvents(sdk.Events{ diff --git a/x/bounty/keeper/msg_server_test.go b/x/bounty/keeper/msg_server_test.go index 09a893a74..5b1e01018 100644 --- a/x/bounty/keeper/msg_server_test.go +++ b/x/bounty/keeper/msg_server_test.go @@ -86,7 +86,7 @@ func (suite *KeeperTestSuite) TestSubmitFinding() { Title: "Test bug 1", Description: "Desc", SubmitterAddress: suite.address[0].String(), - SeverityLevel: types.SeverityLevelCritical, + SeverityLevel: types.Critical, }, }, }, @@ -103,7 +103,7 @@ func (suite *KeeperTestSuite) TestSubmitFinding() { Title: "Test bug 1", Description: "Desc", SubmitterAddress: suite.address[0].String(), - SeverityLevel: types.SeverityLevelCritical, + SeverityLevel: types.Critical, }, }, }, @@ -120,7 +120,7 @@ func (suite *KeeperTestSuite) TestSubmitFinding() { Title: "Test bug 1", Description: "Desc", SubmitterAddress: "Test address", - SeverityLevel: types.SeverityLevelCritical, + SeverityLevel: types.Critical, }, }, }, @@ -187,7 +187,7 @@ func (suite *KeeperTestSuite) TestAcceptFinding() { suite.Require().Equal(finding.Status, types.FindingStatusConfirmed) } else { suite.Require().Error(err) - suite.Require().Equal(finding.Status, types.FindingStatusReported) + suite.Require().Equal(finding.Status, types.FindingStatusSubmitted) } }) } @@ -231,7 +231,7 @@ func (suite *KeeperTestSuite) TestRejectFinding() { suite.Require().Equal(finding.Status, types.FindingStatusClosed) } else { suite.Require().Error(err) - suite.Require().Equal(finding.Status, types.FindingStatusReported) + suite.Require().Equal(finding.Status, types.FindingStatusSubmitted) } }) } @@ -270,7 +270,7 @@ func (suite *KeeperTestSuite) InitSubmitFinding(pid, fid string) string { Title: "Bug title", Description: "Bug desc", SubmitterAddress: suite.address[0].String(), - SeverityLevel: types.SeverityLevelCritical, + SeverityLevel: types.Critical, } ctx := types1.WrapSDKContext(suite.ctx) diff --git a/x/bounty/keeper/program.go b/x/bounty/keeper/program.go index 2c1c31ed4..5328aa351 100644 --- a/x/bounty/keeper/program.go +++ b/x/bounty/keeper/program.go @@ -48,15 +48,16 @@ func (k Keeper) OpenProgram(ctx sdk.Context, pid string, caller sdk.AccAddress) return types.ErrProgramNotExists } + // Check if the program is already closed + if program.Status == types.ProgramStatusActive { + return types.ErrProgramAlreadyActive + } + // Check the permissions. Only the cert address can operate. if !k.certKeeper.IsCertifier(ctx, caller) { return sdkerrors.Wrapf(govtypes.ErrInvalidVote, "%s is not a certified identity", caller.String()) } - if program.Status != types.ProgramStatusInactive { - return types.ErrProgramNotInactive - } - program.Status = types.ProgramStatusActive k.SetProgram(ctx, program) return nil @@ -74,10 +75,8 @@ func (k Keeper) CloseProgram(ctx sdk.Context, pid string, caller sdk.AccAddress) } // Check the permissions. Only the admin of the program or cert address can operate. - if program.AdminAddress != caller.String() { - if !k.certKeeper.IsCertifier(ctx, caller) { - return types.ErrFindingOperatorNotAllowed - } + if program.AdminAddress != caller.String() && !k.certKeeper.IsCertifier(ctx, caller) { + return types.ErrFindingOperatorNotAllowed } // Close the program and update its status in the store diff --git a/x/bounty/types/bounty.pb.go b/x/bounty/types/bounty.pb.go index e03d36097..7ad8470fb 100644 --- a/x/bounty/types/bounty.pb.go +++ b/x/bounty/types/bounty.pb.go @@ -61,27 +61,30 @@ func (ProgramStatus) EnumDescriptor() ([]byte, []int) { type SeverityLevel int32 const ( - SeverityLevelCritical SeverityLevel = 0 - SeverityLevelHigh SeverityLevel = 1 - SeverityLevelMedium SeverityLevel = 2 - SeverityLevelLow SeverityLevel = 3 - SeverityLevelInformational SeverityLevel = 4 + Unspecified SeverityLevel = 0 + Critical SeverityLevel = 1 + High SeverityLevel = 2 + Medium SeverityLevel = 3 + Low SeverityLevel = 4 + Informational SeverityLevel = 5 ) var SeverityLevel_name = map[int32]string{ - 0: "SEVERITY_LEVEL_CRITICAL", - 1: "SEVERITY_LEVEL_HIGH", - 2: "SEVERITY_LEVEL_MEDIUM", - 3: "SEVERITY_LEVEL_LOW", - 4: "SEVERITY_LEVEL_INFORMATIONAL", + 0: "SEVERITY_LEVEL_UNSPECIFIED", + 1: "SEVERITY_LEVEL_CRITICAL", + 2: "SEVERITY_LEVEL_HIGH", + 3: "SEVERITY_LEVEL_MEDIUM", + 4: "SEVERITY_LEVEL_LOW", + 5: "SEVERITY_LEVEL_INFORMATIONAL", } var SeverityLevel_value = map[string]int32{ - "SEVERITY_LEVEL_CRITICAL": 0, - "SEVERITY_LEVEL_HIGH": 1, - "SEVERITY_LEVEL_MEDIUM": 2, - "SEVERITY_LEVEL_LOW": 3, - "SEVERITY_LEVEL_INFORMATIONAL": 4, + "SEVERITY_LEVEL_UNSPECIFIED": 0, + "SEVERITY_LEVEL_CRITICAL": 1, + "SEVERITY_LEVEL_HIGH": 2, + "SEVERITY_LEVEL_MEDIUM": 3, + "SEVERITY_LEVEL_LOW": 4, + "SEVERITY_LEVEL_INFORMATIONAL": 5, } func (x SeverityLevel) String() string { @@ -95,30 +98,27 @@ func (SeverityLevel) EnumDescriptor() ([]byte, []int) { type FindingStatus int32 const ( - FindingStatusReported FindingStatus = 0 - FindingStatusProposed FindingStatus = 1 - FindingStatusActive FindingStatus = 2 - FindingStatusConfirmed FindingStatus = 3 - FindingStatusPaid FindingStatus = 4 - FindingStatusClosed FindingStatus = 5 + FindingStatusSubmitted FindingStatus = 0 + FindingStatusActive FindingStatus = 1 + FindingStatusConfirmed FindingStatus = 2 + FindingStatusPaid FindingStatus = 3 + FindingStatusClosed FindingStatus = 4 ) var FindingStatus_name = map[int32]string{ - 0: "FINDING_STATUS_REPORTED", - 1: "FINDING_STATUS_PROPOSED", - 2: "FINDING_STATUS_ACTIVE", - 3: "FINDING_STATUS_CONFIRMED", - 4: "FINDING_STATUS_PAID", - 5: "FINDING_STATUS_CLOSED", + 0: "FINDING_STATUS_SUBMITTED", + 1: "FINDING_STATUS_ACTIVE", + 2: "FINDING_STATUS_CONFIRMED", + 3: "FINDING_STATUS_PAID", + 4: "FINDING_STATUS_CLOSED", } var FindingStatus_value = map[string]int32{ - "FINDING_STATUS_REPORTED": 0, - "FINDING_STATUS_PROPOSED": 1, - "FINDING_STATUS_ACTIVE": 2, - "FINDING_STATUS_CONFIRMED": 3, - "FINDING_STATUS_PAID": 4, - "FINDING_STATUS_CLOSED": 5, + "FINDING_STATUS_SUBMITTED": 0, + "FINDING_STATUS_ACTIVE": 1, + "FINDING_STATUS_CONFIRMED": 2, + "FINDING_STATUS_PAID": 3, + "FINDING_STATUS_CLOSED": 4, } func (x FindingStatus) String() string { @@ -178,12 +178,13 @@ type Finding struct { FindingId string `protobuf:"bytes,2,opt,name=finding_id,json=findingId,proto3" json:"id" yaml:"id"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` // JSON by FindingDetail - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - SubmitterAddress string `protobuf:"bytes,5,opt,name=submitter_address,json=submitterAddress,proto3" json:"submitter_address,omitempty" yaml:"submitter_address"` - CreateTime time.Time `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3,stdtime" json:"create_time" yaml:"create_time"` - Status FindingStatus `protobuf:"varint,7,opt,name=status,proto3,enum=shentu.bounty.v1.FindingStatus" json:"status,omitempty" yaml:"status"` - FindingHash string `protobuf:"bytes,8,opt,name=finding_hash,json=findingHash,proto3" json:"finding_hash,omitempty" yaml:"finding_hash"` - SeverityLevel SeverityLevel `protobuf:"varint,9,opt,name=severity_level,json=severityLevel,proto3,enum=shentu.bounty.v1.SeverityLevel" json:"severity_level,omitempty" yaml:"severity_level"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + // hash(desc + pos + submitter) + FindingHash string `protobuf:"bytes,5,opt,name=finding_hash,json=findingHash,proto3" json:"finding_hash,omitempty" yaml:"finding_hash"` + SubmitterAddress string `protobuf:"bytes,6,opt,name=submitter_address,json=submitterAddress,proto3" json:"submitter_address,omitempty" yaml:"submitter_address"` + SeverityLevel SeverityLevel `protobuf:"varint,7,opt,name=severity_level,json=severityLevel,proto3,enum=shentu.bounty.v1.SeverityLevel" json:"severity_level,omitempty" yaml:"severity_level"` + Status FindingStatus `protobuf:"varint,8,opt,name=status,proto3,enum=shentu.bounty.v1.FindingStatus" json:"status,omitempty" yaml:"status"` + CreateTime time.Time `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3,stdtime" json:"create_time" yaml:"create_time"` } func (m *Finding) Reset() { *m = Finding{} } @@ -271,77 +272,78 @@ func init() { func init() { proto.RegisterFile("shentu/bounty/v1/bounty.proto", fileDescriptor_36e6d679af1b94c6) } var fileDescriptor_36e6d679af1b94c6 = []byte{ - // 1111 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdb, 0x6e, 0xe2, 0x46, - 0x18, 0xc6, 0x40, 0x0e, 0x0c, 0x21, 0xeb, 0x38, 0x27, 0xc7, 0xca, 0x62, 0xe4, 0xde, 0x44, 0xab, - 0xca, 0x28, 0xb4, 0xaa, 0x56, 0x91, 0x2a, 0x95, 0x53, 0x12, 0xb7, 0x9c, 0x34, 0xb0, 0xa9, 0xda, - 0x5e, 0x50, 0x83, 0x27, 0x30, 0x12, 0xb6, 0x91, 0x6d, 0x68, 0xf2, 0x06, 0x2b, 0xae, 0xf6, 0x05, - 0x90, 0xb6, 0xea, 0x33, 0xb4, 0xcf, 0xb0, 0x97, 0x7b, 0xd7, 0xbd, 0x72, 0x57, 0xc9, 0x4d, 0xd5, - 0x4b, 0x9e, 0xa0, 0xb2, 0x67, 0xbc, 0xc1, 0x2e, 0xe9, 0x41, 0xea, 0xdd, 0xcc, 0xfc, 0xdf, 0xf7, - 0xf1, 0xfb, 0xff, 0xbe, 0x19, 0x01, 0x9e, 0xda, 0x43, 0x64, 0x38, 0x93, 0x7c, 0xcf, 0x9c, 0x18, - 0xce, 0x6d, 0x7e, 0x7a, 0x4a, 0x57, 0xf2, 0xd8, 0x32, 0x1d, 0x93, 0x63, 0x49, 0x59, 0xa6, 0x87, - 0xd3, 0x53, 0x61, 0x6f, 0x60, 0x0e, 0x4c, 0xbf, 0x98, 0xf7, 0x56, 0x04, 0x27, 0x88, 0x03, 0xd3, - 0x1c, 0x8c, 0x50, 0xde, 0xdf, 0xf5, 0x26, 0xd7, 0x79, 0x07, 0xeb, 0xc8, 0x76, 0x54, 0x7d, 0x4c, - 0x01, 0xd9, 0xbe, 0x69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 0xcd, 0x74, 0x41, 0x90, 0xc9, 0xe5, 0x90, 0x83, 0xcb, 0x21, 0x77, 0x82, 0x8b, 0x57, - 0xca, 0xd2, 0xb9, 0xd3, 0x26, 0x97, 0xc8, 0xd2, 0xab, 0xdf, 0x44, 0x06, 0x02, 0x72, 0xe2, 0x11, - 0x96, 0x52, 0xb2, 0xf1, 0x58, 0x4a, 0xa8, 0x19, 0xff, 0x9c, 0x92, 0x33, 0xb0, 0x15, 0xcc, 0x7d, - 0xa8, 0xda, 0x43, 0x7e, 0xd3, 0xff, 0xdc, 0xc3, 0x85, 0x2b, 0xee, 0x12, 0xc2, 0x72, 0x55, 0x82, - 0x69, 0xba, 0xbd, 0x54, 0xed, 0x21, 0xa7, 0x82, 0x6d, 0x1b, 0x4d, 0x91, 0x85, 0x83, 0x84, 0xf0, - 0xa9, 0xc7, 0xfa, 0x69, 0x53, 0x1c, 0x09, 0xd9, 0xd1, 0xc2, 0x15, 0xf7, 0x69, 0x3f, 0x21, 0x01, - 0x09, 0x66, 0xec, 0x65, 0xe4, 0x52, 0xc4, 0x7e, 0x89, 0x83, 0xf4, 0x52, 0x50, 0x57, 0xfc, 0x38, - 0xf3, 0x3f, 0xff, 0x38, 0xc7, 0x82, 0xc4, 0xd8, 0xec, 0xfb, 0x61, 0xdc, 0x84, 0xde, 0x92, 0x6b, - 0x03, 0xe0, 0x3d, 0x01, 0x44, 0xda, 0x8f, 0x5d, 0xba, 0x70, 0x24, 0xd3, 0x07, 0xd0, 0x7b, 0x2d, - 0x65, 0xfa, 0x5a, 0xca, 0x65, 0x13, 0x1b, 0xa5, 0x23, 0x6a, 0x2a, 0x8d, 0xfe, 0x03, 0x55, 0x82, - 0x29, 0x1d, 0x1b, 0xe4, 0x73, 0x7c, 0x51, 0xf5, 0x26, 0x10, 0x4d, 0xfe, 0x57, 0xd1, 0x0f, 0x54, - 0x4f, 0x54, 0xbd, 0x21, 0xa2, 0x0f, 0x83, 0x7b, 0xf6, 0x33, 0x03, 0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 0x7c, 0x63, 0xe8, 0x41, 0xfe, 0x26, 0xf8, 0x8b, 0xe6, - 0xdc, 0x8e, 0x91, 0xdd, 0x5b, 0xf7, 0x1f, 0xfc, 0x4f, 0xfe, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x12, - 0x9e, 0x74, 0xf8, 0xc0, 0x09, 0x00, 0x00, + // 1131 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6e, 0xe2, 0xd6, + 0x1b, 0xc5, 0x40, 0xfe, 0x70, 0x09, 0x33, 0xce, 0x4d, 0x48, 0x1c, 0x2b, 0x83, 0xfd, 0xf3, 0x4f, + 0x95, 0xd2, 0x59, 0x18, 0x85, 0xa9, 0xaa, 0x51, 0xa4, 0x2e, 0x80, 0x90, 0xc4, 0x2d, 0x7f, 0x22, + 0x43, 0x52, 0xb5, 0x5d, 0x50, 0x83, 0x2f, 0x70, 0x25, 0x6c, 0x23, 0xdb, 0xd0, 0xe4, 0x0d, 0x46, + 0xac, 0xa6, 0x0f, 0x80, 0x34, 0x55, 0x9f, 0xa1, 0x7d, 0x86, 0x59, 0xce, 0x72, 0x56, 0xee, 0x28, + 0xd9, 0x54, 0x5d, 0xf2, 0x04, 0x95, 0x7d, 0x2f, 0x13, 0xec, 0x24, 0xfd, 0x23, 0x75, 0x77, 0xef, + 0xf7, 0x9d, 0x73, 0x6c, 0x7f, 0xdf, 0xe1, 0x08, 0xf0, 0xcc, 0x19, 0x20, 0xd3, 0x1d, 0xe7, 0x3b, + 0xd6, 0xd8, 0x74, 0xaf, 0xf3, 0x93, 0x43, 0x7a, 0x92, 0x47, 0xb6, 0xe5, 0x5a, 0x90, 0x25, 0x6d, + 0x99, 0x16, 0x27, 0x87, 0xfc, 0x76, 0xdf, 0xea, 0x5b, 0x41, 0x33, 0xef, 0x9f, 0x08, 0x8e, 0x17, + 0xfa, 0x96, 0xd5, 0x1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, 0xc7, 0xbc, 0xbb, 0xc9, 0x31, 0x1f, 0x6e, 0x72, 0xcc, 0xeb, + 0xdb, 0x5c, 0xec, 0xdd, 0x6d, 0x2e, 0xf6, 0xfe, 0x36, 0x17, 0xfb, 0xf6, 0xb0, 0x8f, 0xdd, 0xc1, + 0xb8, 0x23, 0x77, 0x2d, 0x23, 0x4f, 0x42, 0xa2, 0x67, 0x8d, 0x4d, 0x3d, 0x18, 0x31, 0x2d, 0xe4, + 0xaf, 0x16, 0x7f, 0xae, 0xdc, 0xeb, 0x11, 0x72, 0x3a, 0xab, 0x41, 0x7e, 0xbd, 0xf8, 0x33, 0x00, + 0x00, 0xff, 0xff, 0x31, 0x8a, 0x1a, 0x89, 0x7a, 0x09, 0x00, 0x00, } func (m *Program) Marshal() (dAtA []byte, err error) { @@ -443,23 +445,6 @@ func (m *Finding) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.SeverityLevel != 0 { - i = encodeVarintBounty(dAtA, i, uint64(m.SeverityLevel)) - i-- - dAtA[i] = 0x48 - } - if len(m.FindingHash) > 0 { - i -= len(m.FindingHash) - copy(dAtA[i:], m.FindingHash) - i = encodeVarintBounty(dAtA, i, uint64(len(m.FindingHash))) - i-- - dAtA[i] = 0x42 - } - if m.Status != 0 { - i = encodeVarintBounty(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x38 - } n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreateTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreateTime):]) if err1 != nil { return 0, err1 @@ -467,12 +452,29 @@ func (m *Finding) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n1 i = encodeVarintBounty(dAtA, i, uint64(n1)) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x4a + if m.Status != 0 { + i = encodeVarintBounty(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x40 + } + if m.SeverityLevel != 0 { + i = encodeVarintBounty(dAtA, i, uint64(m.SeverityLevel)) + i-- + dAtA[i] = 0x38 + } if len(m.SubmitterAddress) > 0 { i -= len(m.SubmitterAddress) copy(dAtA[i:], m.SubmitterAddress) i = encodeVarintBounty(dAtA, i, uint64(len(m.SubmitterAddress))) i-- + dAtA[i] = 0x32 + } + if len(m.FindingHash) > 0 { + i -= len(m.FindingHash) + copy(dAtA[i:], m.FindingHash) + i = encodeVarintBounty(dAtA, i, uint64(len(m.FindingHash))) + i-- dAtA[i] = 0x2a } if len(m.Description) > 0 { @@ -637,22 +639,22 @@ func (m *Finding) Size() (n int) { if l > 0 { n += 1 + l + sovBounty(uint64(l)) } - l = len(m.SubmitterAddress) + l = len(m.FindingHash) if l > 0 { n += 1 + l + sovBounty(uint64(l)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreateTime) - n += 1 + l + sovBounty(uint64(l)) - if m.Status != 0 { - n += 1 + sovBounty(uint64(m.Status)) - } - l = len(m.FindingHash) + l = len(m.SubmitterAddress) if l > 0 { n += 1 + l + sovBounty(uint64(l)) } if m.SeverityLevel != 0 { n += 1 + sovBounty(uint64(m.SeverityLevel)) } + if m.Status != 0 { + n += 1 + sovBounty(uint64(m.Status)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreateTime) + n += 1 + l + sovBounty(uint64(l)) return n } @@ -1103,7 +1105,7 @@ func (m *Finding) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubmitterAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FindingHash", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1131,13 +1133,13 @@ func (m *Finding) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SubmitterAddress = string(dAtA[iNdEx:postIndex]) + m.FindingHash = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreateTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SubmitterAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBounty @@ -1147,30 +1149,29 @@ func (m *Finding) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthBounty } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthBounty } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreateTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.SubmitterAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SeverityLevel", wireType) } - m.Status = 0 + m.SeverityLevel = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBounty @@ -1180,16 +1181,16 @@ func (m *Finding) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= FindingStatus(b&0x7F) << shift + m.SeverityLevel |= SeverityLevel(b&0x7F) << shift if b < 0x80 { break } } case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FindingHash", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - var stringLen uint64 + m.Status = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBounty @@ -1199,29 +1200,16 @@ func (m *Finding) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Status |= FindingStatus(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBounty - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBounty - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FindingHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SeverityLevel", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreateTime", wireType) } - m.SeverityLevel = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBounty @@ -1231,11 +1219,25 @@ func (m *Finding) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SeverityLevel |= SeverityLevel(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthBounty + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBounty + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreateTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipBounty(dAtA[iNdEx:]) diff --git a/x/bounty/types/errors.go b/x/bounty/types/errors.go index ab3524fa7..cab4db373 100644 --- a/x/bounty/types/errors.go +++ b/x/bounty/types/errors.go @@ -10,6 +10,7 @@ const ( errProgramFindingListMarshal errProgramFindingListUnmarshal errProgramAlreadyExists + errProgramAlreadyActive errProgramAlreadyClosed errProgramNotExists errProgramInactive @@ -42,10 +43,12 @@ var ( ErrProgramFindingListMarshal = sdkerrors.Register(ModuleName, errProgramFindingListMarshal, "convert uint64 to byte list error") ErrProgramFindingListUnmarshal = sdkerrors.Register(ModuleName, errProgramFindingListUnmarshal, "convert to uint64 list error") ErrProgramAlreadyExists = sdkerrors.Register(ModuleName, errProgramAlreadyExists, "program already exists") + ErrProgramAlreadyActive = sdkerrors.Register(ModuleName, errProgramAlreadyActive, "program already active") ErrProgramAlreadyClosed = sdkerrors.Register(ModuleName, errProgramAlreadyClosed, "program already closed") - ErrProgramNotExists = sdkerrors.Register(ModuleName, errProgramNotExists, "program does not exists") - ErrProgramNotActive = sdkerrors.Register(ModuleName, errProgramInactive, "program status is not active") - ErrProgramNotInactive = sdkerrors.Register(ModuleName, errProgramNotInactive, "program status is not inactive") + + ErrProgramNotExists = sdkerrors.Register(ModuleName, errProgramNotExists, "program does not exists") + ErrProgramNotActive = sdkerrors.Register(ModuleName, errProgramInactive, "program status is not active") + ErrProgramNotInactive = sdkerrors.Register(ModuleName, errProgramNotInactive, "program status is not inactive") ErrProgramCreatorInvalid = sdkerrors.Register(ModuleName, errProgramCreatorInvalid, "invalid program creator") ErrProgramOperatorNotAllowed = sdkerrors.Register(ModuleName, errProgramNotAllowed, "program access denied because you are not the creator or certifiers") diff --git a/x/bounty/types/events.go b/x/bounty/types/events.go index 37fdac3a1..a2f6094a8 100644 --- a/x/bounty/types/events.go +++ b/x/bounty/types/events.go @@ -4,12 +4,13 @@ const ( EventTypeCreateProgram = "create_program" EventTypeEditProgram = "edit_program" EventTypeOpenProgram = "open_program" - EventTypeEndProgram = "end_program" + EventTypeCloseProgram = "close_program" EventTypeSubmitFinding = "submit_finding" + EventTypeEditFinding = "edit_finding" EventTypeRejectFinding = "reject_finding" EventTypeAcceptFinding = "accept_finding" - EventTypeCancelFinding = "cancel_finding" + EventTypeCloseFinding = "close_finding" EventTypeReleaseFinding = "release_finding" AttributeKeyProgramID = "program_id" diff --git a/x/bounty/types/finding.go b/x/bounty/types/finding.go index 846518bfa..9ede560fa 100644 --- a/x/bounty/types/finding.go +++ b/x/bounty/types/finding.go @@ -1,8 +1,6 @@ package types import ( - "crypto/sha256" - "encoding/hex" "fmt" "time" @@ -12,11 +10,7 @@ import ( // Findings is an array of finding type Findings []Finding -func NewFinding(pid, fid, title, desc string, operator sdk.AccAddress, submitTime time.Time, level SeverityLevel) (Finding, error) { - - hash := sha256.Sum256([]byte(title + desc)) - bzHash := hash[:] - hashString := hex.EncodeToString(bzHash) +func NewFinding(pid, fid, title, desc, hash string, operator sdk.AccAddress, submitTime time.Time, level SeverityLevel) (Finding, error) { return Finding{ ProgramId: pid, @@ -25,8 +19,8 @@ func NewFinding(pid, fid, title, desc string, operator sdk.AccAddress, submitTim Description: desc, SubmitterAddress: operator.String(), CreateTime: submitTime, - Status: FindingStatusReported, - FindingHash: hashString, + Status: FindingStatusSubmitted, + FindingHash: hash, SeverityLevel: level, }, nil } diff --git a/x/bounty/types/msgs.go b/x/bounty/types/msgs.go index 5444624b4..508619716 100644 --- a/x/bounty/types/msgs.go +++ b/x/bounty/types/msgs.go @@ -12,6 +12,7 @@ const ( TypeMsgOpenProgram = "open_program" TypeMsgCloseProgram = "close_program" TypeMsgSubmitFinding = "submit_finding" + TypeMsgEditFinding = "edit_finding" TypeMsgAcceptFinding = "accept_finding" TypeMsgRejectFinding = "reject_finding" TypeMsgCloseFinding = "close_finding" @@ -164,6 +165,57 @@ func (msg MsgSubmitFinding) ValidateBasic() error { return nil } +// NewMsgEditFinding submit a new finding. +func NewMsgEditFinding(pid, fid, title, desc string, operator sdk.AccAddress, level SeverityLevel) *MsgEditFinding { + + return &MsgEditFinding{ + ProgramId: pid, + FindingId: fid, + Title: title, + Description: desc, + SubmitterAddress: operator.String(), + SeverityLevel: level, + } +} + +// Route implements the sdk.Msg interface. +func (msg MsgEditFinding) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgEditFinding) Type() string { return TypeMsgEditFinding } + +// GetSigners implements the sdk.Msg interface. It returns the address(es) that +// must sign over msg.GetSignBytes(). +// If the validator address is not same as delegator's, then the validator must +// sign the msg as well. +func (msg MsgEditFinding) GetSigners() []sdk.AccAddress { + // creator should sign the message + cAddr, err := sdk.AccAddressFromBech32(msg.SubmitterAddress) + if err != nil { + panic(err) + } + + return []sdk.AccAddress{cAddr} +} + +// GetSignBytes returns the message bytes to sign over. +func (msg MsgEditFinding) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgEditFinding) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.SubmitterAddress) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid issuer address (%s)", err.Error()) + } + if len(msg.ProgramId) == 0 { + return errors.New("empty pid is not allowed") + } + return nil +} + func NewMsgOpenProgram(pid string, accAddr sdk.AccAddress) *MsgOpenProgram { return &MsgOpenProgram{ ProgramId: pid, diff --git a/x/bounty/types/tx.pb.go b/x/bounty/types/tx.pb.go index b2622975d..866a6f3dd 100644 --- a/x/bounty/types/tx.pb.go +++ b/x/bounty/types/tx.pb.go @@ -346,8 +346,9 @@ type MsgSubmitFinding struct { FindingId string `protobuf:"bytes,2,opt,name=finding_id,json=findingId,proto3" json:"finding_id,omitempty" yaml:"finding_id"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - SubmitterAddress string `protobuf:"bytes,5,opt,name=submitter_address,json=submitterAddress,proto3" json:"submitter_address,omitempty" yaml:"submitter_address"` - SeverityLevel SeverityLevel `protobuf:"varint,6,opt,name=severity_level,json=severityLevel,proto3,enum=shentu.bounty.v1.SeverityLevel" json:"severity_level,omitempty" yaml:"severity_level"` + FindingHash string `protobuf:"bytes,5,opt,name=finding_hash,json=findingHash,proto3" json:"finding_hash,omitempty" yaml:"finding_hash"` + SubmitterAddress string `protobuf:"bytes,6,opt,name=submitter_address,json=submitterAddress,proto3" json:"submitter_address,omitempty" yaml:"submitter_address"` + SeverityLevel SeverityLevel `protobuf:"varint,7,opt,name=severity_level,json=severityLevel,proto3,enum=shentu.bounty.v1.SeverityLevel" json:"severity_level,omitempty" yaml:"severity_level"` } func (m *MsgSubmitFinding) Reset() { *m = MsgSubmitFinding{} } @@ -420,6 +421,86 @@ func (m *MsgSubmitFindingResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitFindingResponse proto.InternalMessageInfo +// MsgEditFinding defines a message to edit a finding. +type MsgEditFinding struct { + ProgramId string `protobuf:"bytes,1,opt,name=program_id,json=programId,proto3" json:"program_id,omitempty" yaml:"program_id"` + FindingId string `protobuf:"bytes,2,opt,name=finding_id,json=findingId,proto3" json:"finding_id,omitempty" yaml:"finding_id"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + SubmitterAddress string `protobuf:"bytes,5,opt,name=submitter_address,json=submitterAddress,proto3" json:"submitter_address,omitempty" yaml:"submitter_address"` + SeverityLevel SeverityLevel `protobuf:"varint,6,opt,name=severity_level,json=severityLevel,proto3,enum=shentu.bounty.v1.SeverityLevel" json:"severity_level,omitempty" yaml:"severity_level"` +} + +func (m *MsgEditFinding) Reset() { *m = MsgEditFinding{} } +func (m *MsgEditFinding) String() string { return proto.CompactTextString(m) } +func (*MsgEditFinding) ProtoMessage() {} +func (*MsgEditFinding) Descriptor() ([]byte, []int) { + return fileDescriptor_1e4b4296bac3db30, []int{10} +} +func (m *MsgEditFinding) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEditFinding) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEditFinding.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgEditFinding) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEditFinding.Merge(m, src) +} +func (m *MsgEditFinding) XXX_Size() int { + return m.Size() +} +func (m *MsgEditFinding) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEditFinding.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEditFinding proto.InternalMessageInfo + +// MsgEditFindingResponse defines the MsgEditFinding response type. +type MsgEditFindingResponse struct { +} + +func (m *MsgEditFindingResponse) Reset() { *m = MsgEditFindingResponse{} } +func (m *MsgEditFindingResponse) String() string { return proto.CompactTextString(m) } +func (*MsgEditFindingResponse) ProtoMessage() {} +func (*MsgEditFindingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1e4b4296bac3db30, []int{11} +} +func (m *MsgEditFindingResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEditFindingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEditFindingResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgEditFindingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEditFindingResponse.Merge(m, src) +} +func (m *MsgEditFindingResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgEditFindingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEditFindingResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEditFindingResponse proto.InternalMessageInfo + // MsgAcceptFinding defines a message to accept a finding to an existing finding. type MsgAcceptFinding struct { FindingId string `protobuf:"bytes,1,opt,name=finding_id,json=findingId,proto3" json:"finding_id,omitempty" yaml:"finding_id"` @@ -431,7 +512,7 @@ func (m *MsgAcceptFinding) Reset() { *m = MsgAcceptFinding{} } func (m *MsgAcceptFinding) String() string { return proto.CompactTextString(m) } func (*MsgAcceptFinding) ProtoMessage() {} func (*MsgAcceptFinding) Descriptor() ([]byte, []int) { - return fileDescriptor_1e4b4296bac3db30, []int{10} + return fileDescriptor_1e4b4296bac3db30, []int{12} } func (m *MsgAcceptFinding) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -468,7 +549,7 @@ func (m *MsgAcceptFindingResponse) Reset() { *m = MsgAcceptFindingRespon func (m *MsgAcceptFindingResponse) String() string { return proto.CompactTextString(m) } func (*MsgAcceptFindingResponse) ProtoMessage() {} func (*MsgAcceptFindingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1e4b4296bac3db30, []int{11} + return fileDescriptor_1e4b4296bac3db30, []int{13} } func (m *MsgAcceptFindingResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -507,7 +588,7 @@ func (m *MsgRejectFinding) Reset() { *m = MsgRejectFinding{} } func (m *MsgRejectFinding) String() string { return proto.CompactTextString(m) } func (*MsgRejectFinding) ProtoMessage() {} func (*MsgRejectFinding) Descriptor() ([]byte, []int) { - return fileDescriptor_1e4b4296bac3db30, []int{12} + return fileDescriptor_1e4b4296bac3db30, []int{14} } func (m *MsgRejectFinding) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -544,7 +625,7 @@ func (m *MsgRejectFindingResponse) Reset() { *m = MsgRejectFindingRespon func (m *MsgRejectFindingResponse) String() string { return proto.CompactTextString(m) } func (*MsgRejectFindingResponse) ProtoMessage() {} func (*MsgRejectFindingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1e4b4296bac3db30, []int{13} + return fileDescriptor_1e4b4296bac3db30, []int{15} } func (m *MsgRejectFindingResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -583,7 +664,7 @@ func (m *MsgCloseFinding) Reset() { *m = MsgCloseFinding{} } func (m *MsgCloseFinding) String() string { return proto.CompactTextString(m) } func (*MsgCloseFinding) ProtoMessage() {} func (*MsgCloseFinding) Descriptor() ([]byte, []int) { - return fileDescriptor_1e4b4296bac3db30, []int{14} + return fileDescriptor_1e4b4296bac3db30, []int{16} } func (m *MsgCloseFinding) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -620,7 +701,7 @@ func (m *MsgCloseFindingResponse) Reset() { *m = MsgCloseFindingResponse func (m *MsgCloseFindingResponse) String() string { return proto.CompactTextString(m) } func (*MsgCloseFindingResponse) ProtoMessage() {} func (*MsgCloseFindingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1e4b4296bac3db30, []int{15} + return fileDescriptor_1e4b4296bac3db30, []int{17} } func (m *MsgCloseFindingResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -660,7 +741,7 @@ func (m *MsgReleaseFinding) Reset() { *m = MsgReleaseFinding{} } func (m *MsgReleaseFinding) String() string { return proto.CompactTextString(m) } func (*MsgReleaseFinding) ProtoMessage() {} func (*MsgReleaseFinding) Descriptor() ([]byte, []int) { - return fileDescriptor_1e4b4296bac3db30, []int{16} + return fileDescriptor_1e4b4296bac3db30, []int{18} } func (m *MsgReleaseFinding) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -718,7 +799,7 @@ func (m *MsgReleaseFindingResponse) Reset() { *m = MsgReleaseFindingResp func (m *MsgReleaseFindingResponse) String() string { return proto.CompactTextString(m) } func (*MsgReleaseFindingResponse) ProtoMessage() {} func (*MsgReleaseFindingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1e4b4296bac3db30, []int{17} + return fileDescriptor_1e4b4296bac3db30, []int{19} } func (m *MsgReleaseFindingResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -758,6 +839,8 @@ func init() { proto.RegisterType((*MsgCloseProgramResponse)(nil), "shentu.bounty.v1.MsgCloseProgramResponse") proto.RegisterType((*MsgSubmitFinding)(nil), "shentu.bounty.v1.MsgSubmitFinding") proto.RegisterType((*MsgSubmitFindingResponse)(nil), "shentu.bounty.v1.MsgSubmitFindingResponse") + proto.RegisterType((*MsgEditFinding)(nil), "shentu.bounty.v1.MsgEditFinding") + proto.RegisterType((*MsgEditFindingResponse)(nil), "shentu.bounty.v1.MsgEditFindingResponse") proto.RegisterType((*MsgAcceptFinding)(nil), "shentu.bounty.v1.MsgAcceptFinding") proto.RegisterType((*MsgAcceptFindingResponse)(nil), "shentu.bounty.v1.MsgAcceptFindingResponse") proto.RegisterType((*MsgRejectFinding)(nil), "shentu.bounty.v1.MsgRejectFinding") @@ -771,64 +854,69 @@ func init() { func init() { proto.RegisterFile("shentu/bounty/v1/tx.proto", fileDescriptor_1e4b4296bac3db30) } var fileDescriptor_1e4b4296bac3db30 = []byte{ - // 909 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4d, 0x6f, 0xf3, 0x44, - 0x10, 0x8e, 0x93, 0xbc, 0x11, 0xd9, 0xbe, 0x49, 0x13, 0xab, 0x6f, 0xeb, 0xb8, 0x6d, 0x1c, 0xcc, - 0x25, 0x05, 0x29, 0x56, 0x4a, 0x4f, 0xbd, 0x35, 0x15, 0x95, 0x0a, 0x54, 0x20, 0xf7, 0x04, 0x42, - 0x0a, 0xfe, 0xd8, 0xba, 0x46, 0xb1, 0xd7, 0xf2, 0x6e, 0xa2, 0xe6, 0x1f, 0x70, 0xe4, 0x08, 0x9c, - 0xfa, 0x37, 0xf8, 0x07, 0x3d, 0xf6, 0xc8, 0xc9, 0xa0, 0x56, 0x42, 0x9c, 0x38, 0x44, 0x42, 0x5c, - 0x91, 0xbd, 0xb6, 0xe3, 0xaf, 0x90, 0xf2, 0xa1, 0xaa, 0x07, 0x6e, 0xde, 0x9d, 0x67, 0x67, 0x9e, - 0x79, 0x66, 0x67, 0x36, 0x01, 0x1d, 0x7c, 0x0d, 0x6d, 0x32, 0x95, 0x54, 0x34, 0xb5, 0xc9, 0x5c, - 0x9a, 0x0d, 0x25, 0x72, 0x33, 0x70, 0x5c, 0x44, 0x10, 0xdb, 0xa2, 0xa6, 0x01, 0x35, 0x0d, 0x66, - 0x43, 0x7e, 0xcb, 0x40, 0x06, 0x0a, 0x8c, 0x92, 0xff, 0x45, 0x71, 0xbc, 0x60, 0x20, 0x64, 0x4c, - 0xa0, 0x14, 0xac, 0xd4, 0xe9, 0x95, 0x44, 0x4c, 0x0b, 0x62, 0xa2, 0x58, 0x4e, 0x08, 0xe8, 0x68, - 0x08, 0x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f0, 0x27, 0xe9, 0xfd, 0x3f, - 0x03, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x48, 0xd3, 0x83, 0xff, 0x0d, 0x00, 0x00, + // 977 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0x8f, 0x93, 0x36, 0x4b, 0xa7, 0x4d, 0xda, 0x9a, 0xee, 0xd6, 0xc9, 0xee, 0xc6, 0xc1, 0x5c, + 0xb2, 0x20, 0xc5, 0x4a, 0xd9, 0x53, 0x6f, 0xcd, 0x8a, 0x15, 0x05, 0x2a, 0x90, 0x7b, 0x02, 0x21, + 0x85, 0xb1, 0x3d, 0x75, 0x8c, 0x62, 0x8f, 0xe5, 0x99, 0x44, 0x9b, 0x6f, 0xc0, 0x91, 0x23, 0x70, + 0xda, 0x33, 0xdf, 0x00, 0x3e, 0xc1, 0x1e, 0xf7, 0xc8, 0xc9, 0x42, 0xad, 0x84, 0x38, 0x70, 0x8a, + 0x84, 0xb8, 0x22, 0xcf, 0xd8, 0x8e, 0xff, 0x85, 0x14, 0x58, 0xaa, 0x22, 0x71, 0xf3, 0xcc, 0xfb, + 0xcd, 0x6f, 0x7e, 0xef, 0xbd, 0x79, 0x2f, 0x2f, 0xa0, 0x45, 0xc6, 0xc8, 0xa5, 0x53, 0x55, 0xc7, + 0x53, 0x97, 0xce, 0xd5, 0xd9, 0x40, 0xa5, 0xcf, 0xfa, 0x9e, 0x8f, 0x29, 0x16, 0xf7, 0xb8, 0xa9, + 0xcf, 0x4d, 0xfd, 0xd9, 0xa0, 0x7d, 0x60, 0x61, 0x0b, 0x33, 0xa3, 0x1a, 0x7e, 0x71, 0x5c, 0x5b, + 0xb6, 0x30, 0xb6, 0x26, 0x48, 0x65, 0x2b, 0x7d, 0x7a, 0xa1, 0x52, 0xdb, 0x41, 0x84, 0x42, 0xc7, + 0x8b,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, 0x9b, 0x2b, 0xb4, 0xa5, 0x41, + 0xed, 0xb7, 0xaf, 0x01, 0x8a, 0xef, 0x18, 0x7e, 0xf0, 0xe2, 0xb2, 0x23, 0xbc, 0xbc, 0xec, 0x08, + 0x3f, 0x5d, 0x76, 0x84, 0xaf, 0xae, 0x3a, 0x95, 0x97, 0x57, 0x9d, 0xca, 0x8f, 0x57, 0x9d, 0xca, + 0xa7, 0x03, 0xcb, 0xa6, 0xe3, 0xa9, 0xde, 0x37, 0xb0, 0xa3, 0x72, 0xc2, 0x0b, 0x3c, 0x75, 0x4d, + 0x18, 0xb6, 0x97, 0x68, 0x43, 0x7d, 0x16, 0xff, 0x8f, 0xa6, 0x73, 0x0f, 0x11, 0xbd, 0xce, 0xfe, + 0x44, 0xbf, 0xf3, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5b, 0xd2, 0x6c, 0x3d, 0x1f, 0x10, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -853,6 +941,8 @@ type MsgClient interface { CloseProgram(ctx context.Context, in *MsgCloseProgram, opts ...grpc.CallOption) (*MsgCloseProgramResponse, error) // SubmitFinding defines a method for submitting a new finding. SubmitFinding(ctx context.Context, in *MsgSubmitFinding, opts ...grpc.CallOption) (*MsgSubmitFindingResponse, error) + // EditFinding defines a method for editing a new finding. + EditFinding(ctx context.Context, in *MsgEditFinding, opts ...grpc.CallOption) (*MsgEditFindingResponse, error) // AcceptFinding defines a method for host accept a finding. AcceptFinding(ctx context.Context, in *MsgAcceptFinding, opts ...grpc.CallOption) (*MsgAcceptFindingResponse, error) // RejectFinding defines a method for host reject a finding. @@ -916,6 +1006,15 @@ func (c *msgClient) SubmitFinding(ctx context.Context, in *MsgSubmitFinding, opt return out, nil } +func (c *msgClient) EditFinding(ctx context.Context, in *MsgEditFinding, opts ...grpc.CallOption) (*MsgEditFindingResponse, error) { + out := new(MsgEditFindingResponse) + err := c.cc.Invoke(ctx, "/shentu.bounty.v1.Msg/EditFinding", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) AcceptFinding(ctx context.Context, in *MsgAcceptFinding, opts ...grpc.CallOption) (*MsgAcceptFindingResponse, error) { out := new(MsgAcceptFindingResponse) err := c.cc.Invoke(ctx, "/shentu.bounty.v1.Msg/AcceptFinding", in, out, opts...) @@ -964,6 +1063,8 @@ type MsgServer interface { CloseProgram(context.Context, *MsgCloseProgram) (*MsgCloseProgramResponse, error) // SubmitFinding defines a method for submitting a new finding. SubmitFinding(context.Context, *MsgSubmitFinding) (*MsgSubmitFindingResponse, error) + // EditFinding defines a method for editing a new finding. + EditFinding(context.Context, *MsgEditFinding) (*MsgEditFindingResponse, error) // AcceptFinding defines a method for host accept a finding. AcceptFinding(context.Context, *MsgAcceptFinding) (*MsgAcceptFindingResponse, error) // RejectFinding defines a method for host reject a finding. @@ -993,6 +1094,9 @@ func (*UnimplementedMsgServer) CloseProgram(ctx context.Context, req *MsgClosePr func (*UnimplementedMsgServer) SubmitFinding(ctx context.Context, req *MsgSubmitFinding) (*MsgSubmitFindingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitFinding not implemented") } +func (*UnimplementedMsgServer) EditFinding(ctx context.Context, req *MsgEditFinding) (*MsgEditFindingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EditFinding not implemented") +} func (*UnimplementedMsgServer) AcceptFinding(ctx context.Context, req *MsgAcceptFinding) (*MsgAcceptFindingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AcceptFinding not implemented") } @@ -1100,6 +1204,24 @@ func _Msg_SubmitFinding_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Msg_EditFinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEditFinding) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EditFinding(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/shentu.bounty.v1.Msg/EditFinding", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EditFinding(ctx, req.(*MsgEditFinding)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_AcceptFinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgAcceptFinding) if err := dec(in); err != nil { @@ -1196,6 +1318,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SubmitFinding", Handler: _Msg_SubmitFinding_Handler, }, + { + MethodName: "EditFinding", + Handler: _Msg_EditFinding_Handler, + }, { MethodName: "AcceptFinding", Handler: _Msg_AcceptFinding_Handler, @@ -1554,13 +1680,20 @@ func (m *MsgSubmitFinding) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.SeverityLevel != 0 { i = encodeVarintTx(dAtA, i, uint64(m.SeverityLevel)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x38 } if len(m.SubmitterAddress) > 0 { i -= len(m.SubmitterAddress) copy(dAtA[i:], m.SubmitterAddress) i = encodeVarintTx(dAtA, i, uint64(len(m.SubmitterAddress))) i-- + dAtA[i] = 0x32 + } + if len(m.FindingHash) > 0 { + i -= len(m.FindingHash) + copy(dAtA[i:], m.FindingHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.FindingHash))) + i-- dAtA[i] = 0x2a } if len(m.Description) > 0 { @@ -1617,6 +1750,92 @@ func (m *MsgSubmitFindingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *MsgEditFinding) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgEditFinding) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEditFinding) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SeverityLevel != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SeverityLevel)) + i-- + dAtA[i] = 0x30 + } + if len(m.SubmitterAddress) > 0 { + i -= len(m.SubmitterAddress) + copy(dAtA[i:], m.SubmitterAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.SubmitterAddress))) + i-- + dAtA[i] = 0x2a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x1a + } + if len(m.FindingId) > 0 { + i -= len(m.FindingId) + copy(dAtA[i:], m.FindingId) + i = encodeVarintTx(dAtA, i, uint64(len(m.FindingId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ProgramId) > 0 { + i -= len(m.ProgramId) + copy(dAtA[i:], m.ProgramId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProgramId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgEditFindingResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgEditFindingResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEditFindingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgAcceptFinding) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2046,6 +2265,10 @@ func (m *MsgSubmitFinding) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.FindingHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.SubmitterAddress) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2065,6 +2288,47 @@ func (m *MsgSubmitFindingResponse) Size() (n int) { return n } +func (m *MsgEditFinding) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProgramId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.FindingId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SubmitterAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.SeverityLevel != 0 { + n += 1 + sovTx(uint64(m.SeverityLevel)) + } + return n +} + +func (m *MsgEditFindingResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgAcceptFinding) Size() (n int) { if m == nil { return 0 @@ -3256,6 +3520,38 @@ func (m *MsgSubmitFinding) Unmarshal(dAtA []byte) error { m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FindingHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FindingHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SubmitterAddress", wireType) } @@ -3287,7 +3583,7 @@ func (m *MsgSubmitFinding) Unmarshal(dAtA []byte) error { } m.SubmitterAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field SeverityLevel", wireType) } @@ -3377,6 +3673,285 @@ func (m *MsgSubmitFindingResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgEditFinding) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgEditFinding: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEditFinding: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProgramId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProgramId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FindingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FindingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubmitterAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubmitterAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SeverityLevel", wireType) + } + m.SeverityLevel = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SeverityLevel |= SeverityLevel(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgEditFindingResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgEditFindingResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEditFindingResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgAcceptFinding) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0