Skip to content

Commit

Permalink
multi: Use const where possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
jholdstock committed Sep 20, 2023
1 parent c8c7664 commit 0b716f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion database/votechange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func exampleRecord() VoteChangeRecord {
}

func testVoteChangeRecords(t *testing.T) {
hash := "MyHash"
const hash = "MyHash"
record := exampleRecord()

// Insert a record into the database.
Expand Down
8 changes: 4 additions & 4 deletions internal/webapi/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ func TestIsValidVoteChoices(t *testing.T) {
func TestIsValidTSpendPolicy(t *testing.T) {

// A valid tspend hash is 32 bytes (64 characters).
validHash := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
anotherValidHash := "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
const validHash = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
const anotherValidHash = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"

var tests = []struct {
tspendPolicy map[string]string
Expand Down Expand Up @@ -102,8 +102,8 @@ func TestIsValidTSpendPolicy(t *testing.T) {
func TestIsValidTreasuryPolicy(t *testing.T) {

// A valid treasury key is 33 bytes (66 characters).
validKey := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
anotherValidKey := "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
const validKey = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
const anotherValidKey = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"

var tests = []struct {
treasuryPolicy map[string]string
Expand Down
2 changes: 1 addition & 1 deletion internal/webapi/setaltsignaddr.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (w *WebAPI) setAltSignAddr(c *gin.Context) {
return
}
if currentData != nil {
msg := "alternate sign address data already exists"
const msg = "alternate sign address data already exists"
w.log.Warnf("%s: %s (ticketHash=%s)", funcName, msg, ticketHash)
w.sendErrorWithMsg(msg, types.ErrBadRequest, c)
return
Expand Down

0 comments on commit 0b716f3

Please sign in to comment.