@@ -371,9 +371,12 @@ func TestGenesisProofVerification(t *testing.T) {
371371 scriptInternalKey := test .RandPrivKey (t ).PubKey ()
372372 leaf1 := test .ScriptHashLock (t , []byte ("foobar" ))
373373 leaf2 := test .ScriptSchnorrSig (t , scriptInternalKey )
374+ testLeafPreimage , err := commitment .NewPreimageFromLeaf (leaf1 )
375+ require .NoError (t , err )
374376
375377 // The order doesn't matter here as they are sorted before hashing.
376378 branch := txscript .NewTapBranch (leaf1 , leaf2 )
379+ testBranchPreimage := commitment .NewPreimageFromBranch (branch )
377380 amount := uint64 (5000 )
378381
379382 testCases := []struct {
@@ -402,20 +405,16 @@ func TestGenesisProofVerification(t *testing.T) {
402405 assetVersion : asset .V1 ,
403406 },
404407 {
405- name : "collectible with leaf preimage" ,
406- assetType : asset .Collectible ,
407- tapscriptPreimage : commitment .NewPreimageFromLeaf (
408- leaf1 ,
409- ),
410- noMetaHash : true ,
408+ name : "collectible with leaf preimage" ,
409+ assetType : asset .Collectible ,
410+ tapscriptPreimage : testLeafPreimage ,
411+ noMetaHash : true ,
411412 },
412413 {
413- name : "collectible with branch preimage" ,
414- assetType : asset .Collectible ,
415- tapscriptPreimage : commitment .NewPreimageFromBranch (
416- branch ,
417- ),
418- noMetaHash : true ,
414+ name : "collectible with branch preimage" ,
415+ assetType : asset .Collectible ,
416+ tapscriptPreimage : & testBranchPreimage ,
417+ noMetaHash : true ,
419418 },
420419 {
421420 name : "normal genesis" ,
@@ -431,22 +430,18 @@ func TestGenesisProofVerification(t *testing.T) {
431430 assetVersion : asset .V1 ,
432431 },
433432 {
434- name : "normal with leaf preimage" ,
435- assetType : asset .Normal ,
436- amount : & amount ,
437- tapscriptPreimage : commitment .NewPreimageFromLeaf (
438- leaf1 ,
439- ),
440- noMetaHash : true ,
433+ name : "normal with leaf preimage" ,
434+ assetType : asset .Normal ,
435+ amount : & amount ,
436+ tapscriptPreimage : testLeafPreimage ,
437+ noMetaHash : true ,
441438 },
442439 {
443- name : "normal with branch preimage" ,
444- assetType : asset .Normal ,
445- amount : & amount ,
446- tapscriptPreimage : commitment .NewPreimageFromBranch (
447- branch ,
448- ),
449- noMetaHash : true ,
440+ name : "normal with branch preimage" ,
441+ assetType : asset .Normal ,
442+ amount : & amount ,
443+ tapscriptPreimage : & testBranchPreimage ,
444+ noMetaHash : true ,
450445 },
451446 {
452447 name : "normal asset with a meta reveal" ,
0 commit comments