From 37531d2b354601bcfea068f1c0c6578fd11669f3 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Fri, 14 Jun 2019 23:00:14 -0500 Subject: [PATCH] dcrutil: Remove Net from Address interface. This removes the no longer necessary Net method from the Address interface and all concrete address implementations. --- dcrutil/address.go | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/dcrutil/address.go b/dcrutil/address.go index 92604106..2d6e7b16 100644 --- a/dcrutil/address.go +++ b/dcrutil/address.go @@ -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 -}