mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
fix go 1.15 build warning (#729)
This commit is contained in:
parent
01311e77f6
commit
4c95227c1d
@ -42,7 +42,7 @@ func (gcps GenesisClaimPeriodIDs) Validate() error {
|
|||||||
seenIDS := make(map[string]bool)
|
seenIDS := make(map[string]bool)
|
||||||
var key string
|
var key string
|
||||||
for _, gcp := range gcps {
|
for _, gcp := range gcps {
|
||||||
key = gcp.CollateralType + string(gcp.ID)
|
key = gcp.CollateralType + fmt.Sprint(gcp.ID)
|
||||||
if seenIDS[key] {
|
if seenIDS[key] {
|
||||||
return fmt.Errorf("duplicated genesis claim period with id %d and collateral type %s", gcp.ID, gcp.CollateralType)
|
return fmt.Errorf("duplicated genesis claim period with id %d and collateral type %s", gcp.ID, gcp.CollateralType)
|
||||||
}
|
}
|
||||||
@ -445,7 +445,7 @@ func (cps ClaimPeriods) Validate() error {
|
|||||||
seenPeriods := make(map[string]bool)
|
seenPeriods := make(map[string]bool)
|
||||||
var key string
|
var key string
|
||||||
for _, cp := range cps {
|
for _, cp := range cps {
|
||||||
key = cp.CollateralType + string(cp.ID)
|
key = cp.CollateralType + fmt.Sprint(cp.ID)
|
||||||
if seenPeriods[key] {
|
if seenPeriods[key] {
|
||||||
return fmt.Errorf("duplicated claim period with id %d and collateral type %s", cp.ID, cp.CollateralType)
|
return fmt.Errorf("duplicated claim period with id %d and collateral type %s", cp.ID, cp.CollateralType)
|
||||||
}
|
}
|
||||||
@ -513,7 +513,7 @@ func (cs Claims) Validate() error {
|
|||||||
seemClaims := make(map[string]bool)
|
seemClaims := make(map[string]bool)
|
||||||
var key string
|
var key string
|
||||||
for _, c := range cs {
|
for _, c := range cs {
|
||||||
key = c.CollateralType + string(c.ClaimPeriodID) + c.Owner.String()
|
key = c.CollateralType + fmt.Sprint(c.ClaimPeriodID) + c.Owner.String()
|
||||||
if c.Owner != nil && seemClaims[key] {
|
if c.Owner != nil && seemClaims[key] {
|
||||||
return fmt.Errorf("duplicated claim from owner %s and collateral type %s", c.Owner, c.CollateralType)
|
return fmt.Errorf("duplicated claim from owner %s and collateral type %s", c.Owner, c.CollateralType)
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ func (gcps GenesisClaimPeriodIDs) Validate() error {
|
|||||||
seenIDS := make(map[string]bool)
|
seenIDS := make(map[string]bool)
|
||||||
var key string
|
var key string
|
||||||
for _, gcp := range gcps {
|
for _, gcp := range gcps {
|
||||||
key = gcp.Denom + string(gcp.ID)
|
key = gcp.Denom + fmt.Sprint(gcp.ID)
|
||||||
if seenIDS[key] {
|
if seenIDS[key] {
|
||||||
return fmt.Errorf("duplicated genesis claim period with id %d and denom %s", gcp.ID, gcp.Denom)
|
return fmt.Errorf("duplicated genesis claim period with id %d and denom %s", gcp.ID, gcp.Denom)
|
||||||
}
|
}
|
||||||
@ -352,7 +352,7 @@ func (cps ClaimPeriods) Validate() error {
|
|||||||
seenPeriods := make(map[string]bool)
|
seenPeriods := make(map[string]bool)
|
||||||
var key string
|
var key string
|
||||||
for _, cp := range cps {
|
for _, cp := range cps {
|
||||||
key = cp.Denom + string(cp.ID)
|
key = cp.Denom + fmt.Sprint(cp.ID)
|
||||||
if seenPeriods[key] {
|
if seenPeriods[key] {
|
||||||
return fmt.Errorf("duplicated claim period with id %d and denom %s", cp.ID, cp.Denom)
|
return fmt.Errorf("duplicated claim period with id %d and denom %s", cp.ID, cp.Denom)
|
||||||
}
|
}
|
||||||
@ -417,7 +417,7 @@ func (cs Claims) Validate() error {
|
|||||||
seemClaims := make(map[string]bool)
|
seemClaims := make(map[string]bool)
|
||||||
var key string
|
var key string
|
||||||
for _, c := range cs {
|
for _, c := range cs {
|
||||||
key = c.Denom + string(c.ClaimPeriodID) + c.Owner.String()
|
key = c.Denom + fmt.Sprint(c.ClaimPeriodID) + c.Owner.String()
|
||||||
if c.Owner != nil && seemClaims[key] {
|
if c.Owner != nil && seemClaims[key] {
|
||||||
return fmt.Errorf("duplicated claim from owner %s and denom %s", c.Owner, c.Denom)
|
return fmt.Errorf("duplicated claim from owner %s and denom %s", c.Owner, c.Denom)
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ func (gcps GenesisClaimPeriodIDs) Validate() error {
|
|||||||
seenIDS := make(map[string]bool)
|
seenIDS := make(map[string]bool)
|
||||||
var key string
|
var key string
|
||||||
for _, gcp := range gcps {
|
for _, gcp := range gcps {
|
||||||
key = gcp.CollateralType + string(gcp.ID)
|
key = gcp.CollateralType + fmt.Sprint(gcp.ID)
|
||||||
if seenIDS[key] {
|
if seenIDS[key] {
|
||||||
return fmt.Errorf("duplicated genesis claim period with id %d and collateral type %s", gcp.ID, gcp.CollateralType)
|
return fmt.Errorf("duplicated genesis claim period with id %d and collateral type %s", gcp.ID, gcp.CollateralType)
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ func (cps ClaimPeriods) Validate() error {
|
|||||||
seenPeriods := make(map[string]bool)
|
seenPeriods := make(map[string]bool)
|
||||||
var key string
|
var key string
|
||||||
for _, cp := range cps {
|
for _, cp := range cps {
|
||||||
key = cp.CollateralType + string(cp.ID)
|
key = cp.CollateralType + fmt.Sprint(cp.ID)
|
||||||
if seenPeriods[key] {
|
if seenPeriods[key] {
|
||||||
return fmt.Errorf("duplicated claim period with id %d and collateral type %s", cp.ID, cp.CollateralType)
|
return fmt.Errorf("duplicated claim period with id %d and collateral type %s", cp.ID, cp.CollateralType)
|
||||||
}
|
}
|
||||||
@ -251,7 +251,7 @@ func (cs Claims) Validate() error {
|
|||||||
seemClaims := make(map[string]bool)
|
seemClaims := make(map[string]bool)
|
||||||
var key string
|
var key string
|
||||||
for _, c := range cs {
|
for _, c := range cs {
|
||||||
key = c.CollateralType + string(c.ClaimPeriodID) + c.Owner.String()
|
key = c.CollateralType + fmt.Sprint(c.ClaimPeriodID) + c.Owner.String()
|
||||||
if c.Owner != nil && seemClaims[key] {
|
if c.Owner != nil && seemClaims[key] {
|
||||||
return fmt.Errorf("duplicated claim from owner %s and collateral type %s", c.Owner, c.CollateralType)
|
return fmt.Errorf("duplicated claim from owner %s and collateral type %s", c.Owner, c.CollateralType)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user