@@ -727,30 +727,6 @@ func (v *Verifier) verifySupplyLeaves(ctx context.Context,
727727 return nil
728728}
729729
730- // fetchDelegationKey fetches the delegation key for the given asset specifier.
731- func (v * Verifier ) fetchDelegationKey (ctx context.Context ,
732- assetSpec asset.Specifier ) (btcec.PublicKey , error ) {
733-
734- var zero btcec.PublicKey
735-
736- metaReveal , err := supplycommit .FetchLatestAssetMetadata (
737- ctx , v .cfg .AssetLookup , assetSpec ,
738- )
739- if err != nil {
740- return zero , fmt .Errorf ("unable to fetch asset " +
741- "metadata: %w" , err )
742- }
743-
744- delegationKey , err := metaReveal .DelegationKey .UnwrapOrErr (
745- fmt .Errorf ("missing delegation key in asset metadata" ),
746- )
747- if err != nil {
748- return zero , err
749- }
750-
751- return delegationKey , nil
752- }
753-
754730// VerifyCommit verifies a supply commitment for a given asset group.
755731// Verification succeeds only if all previous supply commitment dependencies
756732// are known and verified. The dependency chain must be traceable back to the
@@ -801,7 +777,9 @@ func (v *Verifier) VerifyCommit(ctx context.Context,
801777 "commitment with given outpoint: %w" , err )
802778 }
803779
804- delegationKey , err := v .fetchDelegationKey (ctx , assetSpec )
780+ delegationKey , err := FetchDelegationKey (
781+ ctx , v .cfg .AssetLookup , assetSpec ,
782+ )
805783 if err != nil {
806784 return fmt .Errorf ("unable to fetch delegation key: %w" , err )
807785 }
0 commit comments