multi: Use const where possible.

This commit is contained in:
jholdstock 2023-09-20 14:08:09 +01:00 committed by Jamie Holdstock
parent e9cd529de5
commit f8bd606468
3 changed files with 6 additions and 6 deletions

View File

@ -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.

View File

@ -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
@ -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

View File

@ -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