-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release finding #585
Release finding #585
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## bounty #585 +/- ##
=========================================
Coverage ? 41.11%
=========================================
Files ? 146
Lines ? 13140
Branches ? 0
=========================================
Hits ? 5403
Misses ? 7231
Partials ? 506 |
|
||
func NewReleaseFindingCmd() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "release-finding", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use release-finding 1
instead of release-finding --finding-id 1
, it may be more user-friendly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all commands should use the same command format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there are currently 2 formats, and should be unified.
x/bounty/client/cli/utils_test.go
Outdated
@@ -3,6 +3,8 @@ package cli | |||
import ( | |||
"bytes" | |||
"crypto/rand" | |||
codectypes "github.com/cosmos/cosmos-sdk/codec/types" | |||
"github.com/shentufoundation/shentu/v2/x/bounty/types" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be sorted later
option (gogoproto.equal) = false; | ||
|
||
uint64 finding_id = 1 [(gogoproto.moretags) = "yaml:\"finding_id\""]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might also need release all or some findings of a given program.
proto/shentu/bounty/v1/bounty.proto
Outdated
google.protobuf.Any encrypted_poc = 7 [(cosmos_proto.accepts_interface) = "EncryptedPoc",(gogoproto.moretags) = "yaml:\"encrypted_poc\""]; | ||
string poc = 8 [(gogoproto.moretags) = "yaml:\"poc\""]; | ||
string submitter_address = 9 [(gogoproto.moretags) = "yaml:\"submitter_address\""]; | ||
FindingStatus finding_status = 10 [(gogoproto.moretags) = "yaml:\"finding_status\""]; | ||
google.protobuf.Any encrypted_comment = 11 [(cosmos_proto.accepts_interface) = "EncryptedComment",(gogoproto.moretags) = "yaml:\"encrypted_comment\""]; | ||
string comment = 12 [(cosmos_proto.accepts_interface) = "Comment",(gogoproto.moretags) = "yaml:\"comment\""]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think encrypted_poc & poc or encrypted_comment & comment pairs can be merged to accept an interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I will merge these.
x/bounty/client/cli/helper.go
Outdated
limit := uint64(100) | ||
page := uint64(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should accept these as flags
x/bounty/client/cli/helper.go
Outdated
res, err := queryClient.Findings( | ||
cmd.Context(), | ||
&types.QueryFindingsRequest{ | ||
ProgramId: programID, | ||
Pagination: pageReq, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably should just return this result
@@ -359,3 +358,107 @@ func HostProcessFinding(cmd *cobra.Command, args []string) (fid uint64, | |||
|
|||
return fid, commentAny, hostAddr, nil | |||
} | |||
|
|||
func NewReleaseFindingCmd() *cobra.Command { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was deprecated in favor of providing the decrypted plaintext for each finding to be verified by encrypting it again and matching it with the on-chain encrypted ciphertext
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so you'd only be able to release findings one by one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense
… one accept interface
f217038
to
e6834bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bounty's cli request method should be unified. Currently, there are two methods.
Closes: #556
Related: #XXX
Description
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)