This commit is contained in:
Qt 2025-03-27 14:16:16 +08:00 committed by GitHub
commit d2e9b53d4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View File

@ -3,6 +3,7 @@ package cli
import (
"context"
"encoding/hex"
"errors"
"fmt"
"strconv"
"strings"
@ -179,7 +180,7 @@ func QueryGetAssetSuppliesCmd(queryRoute string) *cobra.Command {
}
if len(res.AssetSupplies) == 0 {
return fmt.Errorf("there are currently no asset supplies")
return errors.New("there are currently no asset supplies")
}
return clientCtx.PrintProto(res)

View File

@ -2,6 +2,7 @@ package cli
import (
"encoding/hex"
"errors"
"fmt"
"strconv"
"strings"
@ -140,7 +141,7 @@ func GetCmdClaimAtomicSwap() *cobra.Command {
}
if len(strings.TrimSpace(args[1])) == 0 {
return fmt.Errorf("random-number cannot be empty")
return errors.New("random-number cannot be empty")
}
randomNumber, err := hex.DecodeString(args[1])
if err != nil {

View File

@ -3,6 +3,7 @@ package keeper
import (
"bytes"
"encoding/hex"
"errors"
"fmt"
"time"
@ -31,7 +32,7 @@ func (k Keeper) CreateAtomicSwap(ctx sdk.Context, randomNumberHash []byte, times
}
if len(amount) != 1 {
return fmt.Errorf("amount must contain exactly one coin")
return errors.New("amount must contain exactly one coin")
}
asset, err := k.GetAsset(ctx, amount[0].Denom)
if err != nil {