Skip to content

Commit 2751889

Browse files
committed
remove unused code
1 parent 73571d7 commit 2751889

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

zetaclient/chains/bitcoin/tx_script.go

+6-10
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ const (
3535

3636
// LengthScriptP2PKH is the length of P2PKH script [OP_DUP OP_HASH160 0x14 <20-byte-hash> OP_EQUALVERIFY OP_CHECKSIG]
3737
LengthScriptP2PKH = 25
38-
39-
// LengthInscriptionEnvelope is the length of the witness tapscript envelope for holding pushed data
40-
LengthInscriptionEnvelope = 34
41-
42-
// LengthInscriptionWrapper is the length of the witness tapscript envelope for holding pushed data
43-
LengthInscriptionWrapper = 34
4438
)
4539

4640
// PayToAddrScript creates a new script to pay a transaction output to a the
@@ -199,7 +193,7 @@ func DecodeOpReturnMemo(scriptHex string, txid string) ([]byte, bool, error) {
199193
return nil, false, nil
200194
}
201195

202-
// DecodeScript decodes memo wrapped in a inscription like script in witness
196+
// DecodeScript decodes memo wrapped in an inscription like script in witness
203197
// returns (memo, found, error)
204198
//
205199
// Note: the format of the script is following that of "inscription" defined in ordinal theory.
@@ -287,11 +281,13 @@ func DecodeTSSVout(vout btcjson.Vout, receiverExpected string, chain chains.Chai
287281
// OP_FALSE
288282
// OP_IF
289283
//
290-
// OP_PUSHDATA_N ...
284+
// OP_PUSHDATA_N ...
285+
// ...
286+
// OP_PUSHDATA_N ...
291287
//
292288
// OP_ENDIF
293289
//
294-
// Note: the data pushed in OP_PUSHDATA_N will always be more than 80 bytes and not greater than 520 bytes.
290+
// Note: the total data pushed will always be more than 80 bytes and within the btc transaction size limit.
295291
func decodeInscriptionPayload(t *scriptTokenizer) ([]byte, error) {
296292
if !t.Next() || t.Opcode() != txscript.OP_FALSE {
297293
return nil, fmt.Errorf("OP_FALSE not found")
@@ -302,7 +298,7 @@ func decodeInscriptionPayload(t *scriptTokenizer) ([]byte, error) {
302298
}
303299

304300
memo := make([]byte, 0)
305-
next := byte(txscript.OP_IF)
301+
var next byte
306302
for {
307303
if !t.Next() {
308304
if t.Err() != nil {

0 commit comments

Comments
 (0)