@@ -27,10 +27,10 @@ func TestScriptPubkeyFromRaw(t *testing.T) {
2727 }
2828 defer scriptPubkey .Destroy ()
2929
30- // Test getting script pubkey data
31- data , err := scriptPubkey .Data ()
30+ // Test getting the serialized script pubkey
31+ data , err := scriptPubkey .Bytes ()
3232 if err != nil {
33- t .Fatalf ("ScriptPubkey.Data () error = %v" , err )
33+ t .Fatalf ("ScriptPubkey.Bytes () error = %v" , err )
3434 }
3535
3636 if len (data ) != len (scriptBytes ) {
@@ -71,22 +71,22 @@ func TestScriptPubkeyCopy(t *testing.T) {
7171 }
7272
7373 // Verify copy has same data
74- originalData , err := scriptPubkey .Data ()
74+ originalData , err := scriptPubkey .Bytes ()
7575 if err != nil {
76- t .Fatalf ("Original ScriptPubkey.Data () error = %v" , err )
76+ t .Fatalf ("Original ScriptPubkey.Bytes () error = %v" , err )
7777 }
7878
79- copyData , err := scriptCopy .Data ()
79+ copyData , err := scriptCopy .Bytes ()
8080 if err != nil {
81- t .Fatalf ("Copied ScriptPubkey.Data () error = %v" , err )
81+ t .Fatalf ("Copied ScriptPubkey.Bytes () error = %v" , err )
8282 }
8383
8484 if hex .EncodeToString (originalData ) != hex .EncodeToString (copyData ) {
8585 t .Error ("Copied script pubkey data doesn't match original" )
8686 }
8787}
8888
89- func TestScriptPubkeyData (t * testing.T ) {
89+ func TestScriptPubkeyBytes (t * testing.T ) {
9090 scriptHex := "76a914389ffce9cd9ae88dcc0631e88a821ffdbe9bfe26158088ac"
9191 scriptBytes , err := hex .DecodeString (scriptHex )
9292 if err != nil {
@@ -100,9 +100,9 @@ func TestScriptPubkeyData(t *testing.T) {
100100 defer scriptPubkey .Destroy ()
101101
102102 // Test serializing script to bytes
103- serialized , err := scriptPubkey .Data ()
103+ serialized , err := scriptPubkey .Bytes ()
104104 if err != nil {
105- t .Fatalf ("ScriptPubkey.Data () error = %v" , err )
105+ t .Fatalf ("ScriptPubkey.Bytes () error = %v" , err )
106106 }
107107
108108 if len (serialized ) == 0 {
0 commit comments