diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go index 7d55522..eb211c7 100644 --- a/testutil/sample/sample.go +++ b/testutil/sample/sample.go @@ -5,14 +5,13 @@ import ( machinetypes "planetmint-go/x/machine/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" ) // KeyPair returns a sample private / public keypair func KeyPair() (string, string) { secret := "Don't tell anybody" - sk := secp256k1.GenPrivKeyFromSecret([]byte(secret)) + sk := ed25519.GenPrivKeyFromSecret([]byte(secret)) pk := sk.PubKey() return hex.EncodeToString(sk.Bytes()), hex.EncodeToString(pk.Bytes()) } diff --git a/x/asset/keeper/msg_server_notarize_asset.go b/x/asset/keeper/msg_server_notarize_asset.go index 4ae2282..f086bb7 100644 --- a/x/asset/keeper/msg_server_notarize_asset.go +++ b/x/asset/keeper/msg_server_notarize_asset.go @@ -8,7 +8,7 @@ import ( "planetmint-go/x/asset/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -47,7 +47,7 @@ func ValidateSignature(message string, signature string, publicKey string) bool hash := sha256.Sum256(messageBytes) // Create a secp256k1 public key object - pubKey := &secp256k1.PubKey{Key: publicKeyBytes} + pubKey := &ed25519.PubKey{Key: publicKeyBytes} // Verify the signature isValid := pubKey.VerifySignature(hash[:], signatureBytes) diff --git a/x/asset/keeper/msg_server_test.go b/x/asset/keeper/msg_server_test.go index a1eeede..63a805f 100644 --- a/x/asset/keeper/msg_server_test.go +++ b/x/asset/keeper/msg_server_test.go @@ -11,7 +11,7 @@ import ( "planetmint-go/x/asset/keeper" "planetmint-go/x/asset/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" ) @@ -29,7 +29,7 @@ func TestMsgServerNotarizeAsset(t *testing.T) { if err != nil { assert.Equal(t, true, false) } - privKey := &secp256k1.PrivKey{Key: skBytes} + privKey := &ed25519.PrivKey{Key: skBytes} cidBytes, _ := hex.DecodeString(cid) hash := sha256.Sum256(cidBytes)