@@ -35,6 +35,8 @@ Zora.test("memo lengths", function (t) {
35
35
let memo77 = "cc" . repeat ( 77 ) ;
36
36
let memo80 = "bb" . repeat ( 80 ) ;
37
37
let memo81 = "aa" . repeat ( 81 ) ;
38
+ let memoProposal =
39
+ "2f3dbf4094c26594c7cd4b1c3d0af3740181d7e57f9f4faf5b7edbf6eddf4954" ;
38
40
39
41
let size1 = "01" ;
40
42
let size3 = "03" ;
@@ -47,41 +49,47 @@ Zora.test("memo lengths", function (t) {
47
49
//let size81 = "51";
48
50
//let size82 = "52";
49
51
let size83 = "53" ;
52
+ let sizeProposal = "20" ;
50
53
51
54
let OP_PD1 = "4c" ;
52
55
53
56
t . throws (
54
57
function ( ) {
55
- DashTx . _createMemoScript ( memo81 ) ;
58
+ DashTx . _createMemoScript ( memo81 , 0 ) ;
56
59
} ,
57
60
/ \b 8 0 b y t e s \b / ,
58
61
"memo > 80 bytes should throw an error" ,
59
62
) ;
60
63
61
- let tx1 = DashTx . _createMemoScript ( memo1 ) ;
64
+ let tx1 = DashTx . _createMemoScript ( memo1 , 0 ) ;
62
65
let tx1a = `0000000000000000${ size3 } 6a${ size1 } ${ memo1 } ` ;
63
66
let tx1b = tx1 . join ( "" ) ;
64
67
t . deepEqual ( tx1b , tx1a , "single-byte memo fits" ) ;
65
68
66
- let tx75 = DashTx . _createMemoScript ( memo75 ) ;
69
+ let tx75 = DashTx . _createMemoScript ( memo75 , 0 ) ;
67
70
let tx75a = `0000000000000000${ size77 } 6a${ size75 } ${ memo75 } ` ;
68
71
let tx75b = tx75 . join ( "" ) ;
69
72
t . deepEqual ( tx75b , tx75a , "75-byte memo fits" ) ;
70
73
71
74
let tx76a = `0000000000000000${ size79 } 6a${ OP_PD1 } ${ size76 } ${ memo76 } ` ;
72
- let tx76 = DashTx . _createMemoScript ( memo76 ) ;
75
+ let tx76 = DashTx . _createMemoScript ( memo76 , 0 ) ;
73
76
let tx76b = tx76 . join ( "" ) ;
74
77
t . deepEqual ( tx76b , tx76a , "76-byte memo fits with OP_PUSHDATA1" ) ;
75
78
76
79
let tx77a = `0000000000000000${ size80 } 6a${ OP_PD1 } ${ size77 } ${ memo77 } ` ;
77
- let tx77 = DashTx . _createMemoScript ( memo77 ) ;
80
+ let tx77 = DashTx . _createMemoScript ( memo77 , 0 ) ;
78
81
let tx77b = tx77 . join ( "" ) ;
79
82
t . deepEqual ( tx77b , tx77a , "77-byte memo fits with OP_PUSHDATA1" ) ;
80
83
81
84
let tx80a = `0000000000000000${ size83 } 6a${ OP_PD1 } ${ size80 } ${ memo80 } ` ;
82
- let tx80 = DashTx . _createMemoScript ( memo80 ) ;
85
+ let tx80 = DashTx . _createMemoScript ( memo80 , 0 ) ;
83
86
let tx80b = tx80 . join ( "" ) ;
84
87
t . deepEqual ( tx80b , tx80a , "80-byte memo fits with OP_PUSHDATA1" ) ;
88
+
89
+ let txProposalA = `00e1f50500000000226a202f3dbf4094c26594c7cd4b1c3d0af3740181d7e57f9f4faf5b7edbf6eddf4954` ;
90
+ let txProposal = DashTx . _createMemoScript ( memoProposal , 100000000 ) ;
91
+ let txProposalB = txProposal . join ( "" ) ;
92
+ t . deepEqual ( txProposalB , txProposalA , "32-byte memo fits with OP_PUSHDATA1" ) ;
85
93
} ) ;
86
94
87
95
Zora . test ( "can create memo tx" , async function ( t ) {
0 commit comments