From 86ce4db1b038f56a01ea3283ce28db8c3af766a0 Mon Sep 17 00:00:00 2001 From: Philipp Gackstatter Date: Mon, 11 Mar 2024 16:47:52 +0800 Subject: [PATCH] Remove never returned error from newAddress --- address.go | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/address.go b/address.go index 7f2f74150..23dbaa964 100644 --- a/address.go +++ b/address.go @@ -173,22 +173,22 @@ type UTXOIDChainID interface { FromOutputID(id OutputID) ChainID } -func newAddress(addressType AddressType) (address Address, err error) { +func newAddress(addressType AddressType) Address { switch addressType { case AddressEd25519: - return &Ed25519Address{}, nil + return &Ed25519Address{} case AddressAccount: - return &AccountAddress{}, nil + return &AccountAddress{} case AddressNFT: - return &NFTAddress{}, nil + return &NFTAddress{} case AddressAnchor: - return &AnchorAddress{}, nil + return &AnchorAddress{} case AddressImplicitAccountCreation: - return &ImplicitAccountCreationAddress{}, nil + return &ImplicitAccountCreationAddress{} case AddressMulti: - return &MultiAddress{}, nil + return &MultiAddress{} case AddressRestricted: - return &RestrictedAddress{}, nil + return &RestrictedAddress{} default: panic(fmt.Sprintf("unknown address type %d", addressType)) } @@ -252,10 +252,7 @@ func ParseBech32(s string) (NetworkPrefix, Address, error) { } } - addr, err := newAddress(addrType) - if err != nil { - return "", nil, err - } + addr := newAddress(addrType) serixAPI := CommonSerixAPI() n, err := serixAPI.Decode(context.TODO(), addrData, addr)