From 15b866ae67bdb7ca4872f4089fcab19f9e2e3608 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 3 Mar 2021 20:54:13 +0100 Subject: [PATCH] Use cryptotypes.Address instead of tmcrypto --- crypto/keys/internal/ecdsa/pubkey.go | 7 +++---- crypto/keys/secp256r1/pubkey.go | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/crypto/keys/internal/ecdsa/pubkey.go b/crypto/keys/internal/ecdsa/pubkey.go index 4c9b493a6b5f..4394634a30e9 100644 --- a/crypto/keys/internal/ecdsa/pubkey.go +++ b/crypto/keys/internal/ecdsa/pubkey.go @@ -8,8 +8,7 @@ import ( "fmt" "math/big" - tmcrypto "github.com/tendermint/tendermint/crypto" - + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -23,11 +22,11 @@ type PubKey struct { ecdsa.PublicKey // cache - address tmcrypto.Address + address cryptotypes.Address } // Address creates an ADR-28 address for ECDSA keys. protoName is a concrete proto structure id. -func (pk *PubKey) Address(protoName string) tmcrypto.Address { +func (pk *PubKey) Address(protoName string) cryptotypes.Address { if pk.address == nil { pk.address = address.Hash(protoName, pk.Bytes()) } diff --git a/crypto/keys/secp256r1/pubkey.go b/crypto/keys/secp256r1/pubkey.go index c844369b057e..10d6c594cf2e 100644 --- a/crypto/keys/secp256r1/pubkey.go +++ b/crypto/keys/secp256r1/pubkey.go @@ -1,8 +1,6 @@ package secp256r1 import ( - tmcrypto "github.com/tendermint/tendermint/crypto" - ecdsa "github.com/cosmos/cosmos-sdk/crypto/keys/internal/ecdsa" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) @@ -27,7 +25,7 @@ func (m *PubKey) Equals(other cryptotypes.PubKey) bool { } // Address implements SDK PubKey interface. -func (m *PubKey) Address() tmcrypto.Address { +func (m *PubKey) Address() cryptotypes.Address { return m.Key.Address(m.XXX_MessageName()) }