Skip to content

Commit

Permalink
chore: change prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Dec 14, 2023
1 parent 6b8347c commit e3e28c6
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 77 deletions.
2 changes: 1 addition & 1 deletion proto/tendermint/abci/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ message ExtendVoteExtension {

// If not set, Tenderdash will generate it based on height and round.
//
// If set, it SHOULD be unique per voting round, and it MUST start with `dpevote` or `plwdtx` string.
// If set, it SHOULD be unique per voting round, and it MUST start with `dpevote` or `\x06plwdtx` prefix.
//
// Use with caution - it can have severe security consequences.
optional bytes sign_request_id = 3;
Expand Down
4 changes: 2 additions & 2 deletions proto/tendermint/types/dash.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var (
errExtensionSignEmpty = errors.New("vote extension signature is missing")
errExtensionSignTooBig = fmt.Errorf("vote extension signature is too big (max: %d)", bls12381.SignatureSize)
errExtensionSignRequestIdNotSupported = errors.New("vote extension sign request id is not supported")

Check warning on line 18 in proto/tendermint/types/dash.go

View workflow job for this annotation

GitHub Actions / golangci-lint

var-naming: var errExtensionSignRequestIdNotSupported should be errExtensionSignRequestIDNotSupported (revive)
errExtensionSignRequestIdWrongPrefix = errors.New("vote extension sign request id must have dpevote or plwdtx prefix")
errExtensionSignRequestIdWrongPrefix = errors.New("vote extension sign request id must have dpevote or \\x06plwdtx prefix")

Check warning on line 19 in proto/tendermint/types/dash.go

View workflow job for this annotation

GitHub Actions / golangci-lint

var-naming: var errExtensionSignRequestIdWrongPrefix should be errExtensionSignRequestIDWrongPrefix (revive)
)

// Clone returns a copy of current vote-extension
Expand Down Expand Up @@ -64,7 +64,7 @@ func (v *VoteExtension) Validate() error {
if v.Type != VoteExtensionType_THRESHOLD_RECOVER_RAW {
return errExtensionSignRequestIdNotSupported
}
var validPrefixes = []string{"plwdtx", "dpevote"}
var validPrefixes = []string{"\x06plwdtx", "dpevote"}
requestID := v.GetSignRequestId()

var validPrefix bool
Expand Down
2 changes: 1 addition & 1 deletion proto/tendermint/types/dash.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ message VoteExtension {

// If not set, Tenderdash will generate it based on height and round.
//
// If set, it SHOULD be unique per voting round, and it MUST start with `dpevote` or `plwdtx` string.
// If set, it SHOULD be unique per voting round, and it MUST start with `dpevote` or `\x06plwdtx` string.
//
// Use with caution - it can have severe security consequences.
optional bytes sign_request_id = 4;
Expand Down
Loading

0 comments on commit e3e28c6

Please sign in to comment.