File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ package  tapscript
2+ 
3+ import  (
4+ 	"encoding/hex" 
5+ 	"testing" 
6+ 
7+ 	"github.com/stretchr/testify/require" 
8+ )
9+ 
10+ // TestNewFundingScriptTree tests the NewFundingScriptTree function. We use this 
11+ // function to filter out assets used for custom channel funding from the 
12+ // balance queries. Therefor the script key cannot change since this would lead 
13+ // to inconsistencies in the balance queries. 
14+ func  TestNewFundingScriptTree (t  * testing.T ) {
15+ 	// This key, threaded through asset.NewScriptKey() would start with 02. 
16+ 	// We don't do that here so we compare it to the expected compressed 
17+ 	// form of the public key. 
18+ 	expectedTaprootKeyHex  :=  "0350aaeb166f4234650d84a2d8a130987aeaf695020"  + 
19+ 		"6e0905401ee74ff3f8d18e6" 
20+ 	expectedTaprootKeyBytes , err  :=  hex .DecodeString (expectedTaprootKeyHex )
21+ 	require .NoError (t , err )
22+ 
23+ 	fundingScriptTree  :=  NewFundingScriptTree ()
24+ 	taprootKey  :=  fundingScriptTree .TaprootKey 
25+ 
26+ 	serializedTaprootKey  :=  taprootKey .SerializeCompressed ()
27+ 	require .Equal (t , expectedTaprootKeyBytes , serializedTaprootKey )
28+ }
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments