multi: Use const where possible.
This commit is contained in:
parent
e9cd529de5
commit
f8bd606468
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user