Commit 26ccabcc authored by suyanlong's avatar suyanlong

remove unused function

parent f2fd7f36
Pipeline #7996 failed with stages
package main package main
import ( import (
"crypto"
"fmt" "fmt"
crypto2 "github.com/libp2p/go-libp2p-core/crypto" crypto2 "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peer"
"github.com/link33/sidecar/internal/repo" "github.com/link33/sidecar/internal/repo"
"github.com/meshplus/bitxhub-kit/crypto/asym" "github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/meshplus/bitxhub-kit/crypto/asym/ecdsa"
"github.com/urfave/cli" "github.com/urfave/cli"
) )
...@@ -53,17 +51,3 @@ func p2pID(ctx *cli.Context) error { ...@@ -53,17 +51,3 @@ func p2pID(ctx *cli.Context) error {
fmt.Println(id) fmt.Println(id)
return nil return nil
} }
func convertToLibp2pPrivKey(privateKey crypto.PrivateKey) (crypto2.PrivKey, error) {
ecdsaPrivKey, ok := privateKey.(*ecdsa.PrivateKey)
if !ok {
return nil, fmt.Errorf("convert to libp2p private key: not ecdsa private key")
}
libp2pPrivKey, _, err := crypto2.ECDSAKeyPairFromKey(ecdsaPrivKey.K)
if err != nil {
return nil, err
}
return libp2pPrivKey, nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment