dcrutil: Remove Net from Address interface.

This removes the no longer necessary Net method from the Address
interface and all concrete address implementations.
This commit is contained in:
Dave Collins 2019-06-14 23:00:14 -05:00
parent 54cd596803
commit 37531d2b35
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2

View File

@ -104,9 +104,6 @@ type Address interface {
// Hash160 returns the Hash160(data) where data is the data normally
// hashed to 160 bits from the respective address type.
Hash160() *[ripemd160.Size]byte
// Net returns the network parameters of the address.
Net() *chaincfg.Params
}
// NewAddressPubKey returns a new Address. decoded must
@ -258,11 +255,6 @@ func (a *AddressPubKeyHash) DSA() dcrec.SignatureType {
return -1
}
// Net returns the network for the address.
func (a *AddressPubKeyHash) Net() *chaincfg.Params {
return a.net
}
// AddressScriptHash is an Address for a pay-to-script-hash (P2SH)
// transaction.
type AddressScriptHash struct {
@ -340,11 +332,6 @@ func (a *AddressScriptHash) Hash160() *[ripemd160.Size]byte {
return &a.hash
}
// Net returns the network for the address.
func (a *AddressScriptHash) Net() *chaincfg.Params {
return a.net
}
// PubKeyFormat describes what format to use for a pay-to-pubkey address.
type PubKeyFormat int
@ -488,11 +475,6 @@ func (a *AddressSecpPubKey) DSA() dcrec.SignatureType {
return -1
}
// Net returns the network for the address.
func (a *AddressSecpPubKey) Net() *chaincfg.Params {
return a.net
}
// NewAddressSecpPubKeyCompressed creates a new address using a compressed public key
func NewAddressSecpPubKeyCompressed(pubkey chainec.PublicKey, params *chaincfg.Params) (*AddressSecpPubKey, error) {
return NewAddressSecpPubKey(pubkey.SerializeCompressed(), params)
@ -579,11 +561,6 @@ func (a *AddressEdwardsPubKey) DSA() dcrec.SignatureType {
return dcrec.STEd25519
}
// Net returns the network for the address.
func (a *AddressEdwardsPubKey) Net() *chaincfg.Params {
return a.net
}
// AddressSecSchnorrPubKey is an Address for a secp256k1 pay-to-pubkey
// transaction.
type AddressSecSchnorrPubKey struct {
@ -665,8 +642,3 @@ func (a *AddressSecSchnorrPubKey) AddressPubKeyHash() *AddressPubKeyHash {
func (a *AddressSecSchnorrPubKey) DSA() dcrec.SignatureType {
return dcrec.STSchnorrSecp256k1
}
// Net returns the network for the address.
func (a *AddressSecSchnorrPubKey) Net() *chaincfg.Params {
return a.net
}