Skip to content

Commit

Permalink
Use cryptotypes.Address instead of tmcrypto
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Mar 3, 2021
1 parent 4a93f10 commit 15b866a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 3 additions & 4 deletions crypto/keys/internal/ecdsa/pubkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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())
}
Expand Down
4 changes: 1 addition & 3 deletions crypto/keys/secp256r1/pubkey.go
Original file line number Diff line number Diff line change
@@ -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"
)
Expand All @@ -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())
}

Expand Down

0 comments on commit 15b866a

Please sign in to comment.