@@ -167,10 +167,8 @@ type Archiver interface {
167
167
// the script key itself. If replace is specified, we expect a proof to
168
168
// already be present, and we just update (replace) it with the new
169
169
// proof.
170
- ImportProofs (ctx context.Context , headerVerifier HeaderVerifier ,
171
- merkleVerifier MerkleVerifier , groupVerifier GroupVerifier ,
172
- chainLookupGen ChainLookupGenerator , replace bool ,
173
- proofs ... * AnnotatedProof ) error
170
+ ImportProofs (ctx context.Context , vCtx VerifierCtx ,
171
+ replace bool , proofs ... * AnnotatedProof ) error
174
172
}
175
173
176
174
// NotifyArchiver is an Archiver that also allows callers to subscribe to
@@ -709,9 +707,8 @@ func (f *FileArchiver) FetchProofs(_ context.Context,
709
707
// update (replace) it with the new proof.
710
708
//
711
709
// NOTE: This implements the Archiver interface.
712
- func (f * FileArchiver ) ImportProofs (_ context.Context ,
713
- _ HeaderVerifier , _ MerkleVerifier , _ GroupVerifier ,
714
- _ ChainLookupGenerator , replace bool , proofs ... * AnnotatedProof ) error {
710
+ func (f * FileArchiver ) ImportProofs (_ context.Context , _ VerifierCtx ,
711
+ replace bool , proofs ... * AnnotatedProof ) error {
715
712
716
713
for _ , proof := range proofs {
717
714
proofPath , err := genProofFileStoragePath (
@@ -906,9 +903,7 @@ func (m *MultiArchiver) FetchProofs(ctx context.Context,
906
903
// ImportProofs attempts to store fully populated proofs on disk. The previous
907
904
// outpoint of the first state transition will be used as the Genesis point.
908
905
// The final resting place of the asset will be used as the script key itself.
909
- func (m * MultiArchiver ) ImportProofs (ctx context.Context ,
910
- headerVerifier HeaderVerifier , merkleVerifier MerkleVerifier ,
911
- groupVerifier GroupVerifier , chainLookupGen ChainLookupGenerator ,
906
+ func (m * MultiArchiver ) ImportProofs (ctx context.Context , vCtx VerifierCtx ,
912
907
replace bool , proofs ... * AnnotatedProof ) error {
913
908
914
909
// Before we import the proofs into the archive, we want to make sure
@@ -917,8 +912,7 @@ func (m *MultiArchiver) ImportProofs(ctx context.Context,
917
912
f := func (c context.Context , proof * AnnotatedProof ) error {
918
913
// First, we'll decode and then also verify the proof.
919
914
finalStateTransition , err := m .proofVerifier .Verify (
920
- c , bytes .NewReader (proof .Blob ), headerVerifier ,
921
- merkleVerifier , groupVerifier , chainLookupGen ,
915
+ c , bytes .NewReader (proof .Blob ), vCtx ,
922
916
)
923
917
if err != nil {
924
918
return fmt .Errorf ("unable to verify proof: %w" , err )
@@ -957,10 +951,7 @@ func (m *MultiArchiver) ImportProofs(ctx context.Context,
957
951
// additional supplementary information into the locator, we'll attempt
958
952
// to import each proof our archive backends.
959
953
for _ , archive := range m .backends {
960
- err := archive .ImportProofs (
961
- ctx , headerVerifier , merkleVerifier , groupVerifier ,
962
- chainLookupGen , replace , proofs ... ,
963
- )
954
+ err := archive .ImportProofs (ctx , vCtx , replace , proofs ... )
964
955
if err != nil {
965
956
return err
966
957
}
@@ -1026,9 +1017,7 @@ var _ NotifyArchiver = (*MultiArchiver)(nil)
1026
1017
// assets of the same ID. This is useful when we want to update the proof with a
1027
1018
// new one after a re-org.
1028
1019
func ReplaceProofInBlob (ctx context.Context , p * Proof , archive Archiver ,
1029
- headerVerifier HeaderVerifier , merkleVerifier MerkleVerifier ,
1030
- groupVerifier GroupVerifier ,
1031
- chainLookupGen ChainLookupGenerator ) error {
1020
+ vCtx VerifierCtx ) error {
1032
1021
1033
1022
// This is a bit of a hacky part. If we have a chain of transactions
1034
1023
// that were re-organized, we can't verify the whole chain until all of
@@ -1037,7 +1026,7 @@ func ReplaceProofInBlob(ctx context.Context, p *Proof, archive Archiver,
1037
1026
// since we don't know if the whole chain has been updated yet (the
1038
1027
// confirmations might come in out of order).
1039
1028
// TODO(guggero): Find a better way to do this.
1040
- headerVerifier = func (wire.BlockHeader , uint32 ) error {
1029
+ vCtx . HeaderVerifier = func (wire.BlockHeader , uint32 ) error {
1041
1030
return nil
1042
1031
}
1043
1032
@@ -1105,10 +1094,7 @@ func ReplaceProofInBlob(ctx context.Context, p *Proof, archive Archiver,
1105
1094
Locator : existingProof .Locator ,
1106
1095
Blob : buf .Bytes (),
1107
1096
}
1108
- err = archive .ImportProofs (
1109
- ctx , headerVerifier , merkleVerifier , groupVerifier ,
1110
- chainLookupGen , true , directProof ,
1111
- )
1097
+ err = archive .ImportProofs (ctx , vCtx , true , directProof )
1112
1098
if err != nil {
1113
1099
return fmt .Errorf ("unable to import updated proof: %w" ,
1114
1100
err )
0 commit comments