From 4c95227c1df568b07316cafa566d7f37345fab2c Mon Sep 17 00:00:00 2001 From: Kevin Davis Date: Thu, 3 Dec 2020 16:07:47 -0700 Subject: [PATCH] fix go 1.15 build warning (#729) --- x/incentive/legacy/v0_11/types.go | 6 +++--- x/incentive/legacy/v0_9/types.go | 6 +++--- x/incentive/types/genesis.go | 2 +- x/incentive/types/rewards.go | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/x/incentive/legacy/v0_11/types.go b/x/incentive/legacy/v0_11/types.go index cee1423b..22d64514 100644 --- a/x/incentive/legacy/v0_11/types.go +++ b/x/incentive/legacy/v0_11/types.go @@ -42,7 +42,7 @@ func (gcps GenesisClaimPeriodIDs) Validate() error { seenIDS := make(map[string]bool) var key string for _, gcp := range gcps { - key = gcp.CollateralType + string(gcp.ID) + key = gcp.CollateralType + fmt.Sprint(gcp.ID) if seenIDS[key] { 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) var key string for _, cp := range cps { - key = cp.CollateralType + string(cp.ID) + key = cp.CollateralType + fmt.Sprint(cp.ID) if seenPeriods[key] { 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) var key string 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] { return fmt.Errorf("duplicated claim from owner %s and collateral type %s", c.Owner, c.CollateralType) } diff --git a/x/incentive/legacy/v0_9/types.go b/x/incentive/legacy/v0_9/types.go index 3d494e44..c8e72afd 100644 --- a/x/incentive/legacy/v0_9/types.go +++ b/x/incentive/legacy/v0_9/types.go @@ -35,7 +35,7 @@ func (gcps GenesisClaimPeriodIDs) Validate() error { seenIDS := make(map[string]bool) var key string for _, gcp := range gcps { - key = gcp.Denom + string(gcp.ID) + key = gcp.Denom + fmt.Sprint(gcp.ID) if seenIDS[key] { 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) var key string for _, cp := range cps { - key = cp.Denom + string(cp.ID) + key = cp.Denom + fmt.Sprint(cp.ID) if seenPeriods[key] { 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) var key string 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] { return fmt.Errorf("duplicated claim from owner %s and denom %s", c.Owner, c.Denom) } diff --git a/x/incentive/types/genesis.go b/x/incentive/types/genesis.go index d67abd41..f4824603 100644 --- a/x/incentive/types/genesis.go +++ b/x/incentive/types/genesis.go @@ -34,7 +34,7 @@ func (gcps GenesisClaimPeriodIDs) Validate() error { seenIDS := make(map[string]bool) var key string for _, gcp := range gcps { - key = gcp.CollateralType + string(gcp.ID) + key = gcp.CollateralType + fmt.Sprint(gcp.ID) if seenIDS[key] { return fmt.Errorf("duplicated genesis claim period with id %d and collateral type %s", gcp.ID, gcp.CollateralType) } diff --git a/x/incentive/types/rewards.go b/x/incentive/types/rewards.go index 6da64a0d..a1b100d0 100644 --- a/x/incentive/types/rewards.go +++ b/x/incentive/types/rewards.go @@ -154,7 +154,7 @@ func (cps ClaimPeriods) Validate() error { seenPeriods := make(map[string]bool) var key string for _, cp := range cps { - key = cp.CollateralType + string(cp.ID) + key = cp.CollateralType + fmt.Sprint(cp.ID) if seenPeriods[key] { 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) var key string 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] { return fmt.Errorf("duplicated claim from owner %s and collateral type %s", c.Owner, c.CollateralType) }