@@ -2936,7 +2936,11 @@ mod tests {
2936
2936
}
2937
2937
}
2938
2938
2939
- pub fn txout_opreturn ( op : & LeaderBlockCommitOp , magic : & MagicBytes ) -> TxOut {
2939
+ pub fn txout_opreturn < T : StacksMessageCodec > (
2940
+ op : & T ,
2941
+ magic : & MagicBytes ,
2942
+ value : u64 ,
2943
+ ) -> TxOut {
2940
2944
let op_bytes = {
2941
2945
let mut buffer = vec ! [ ] ;
2942
2946
let mut magic_bytes = magic. as_bytes ( ) . to_vec ( ) ;
@@ -2947,7 +2951,7 @@ mod tests {
2947
2951
} ;
2948
2952
2949
2953
TxOut {
2950
- value : op . sunset_burn ,
2954
+ value,
2951
2955
script_pubkey : Builder :: new ( )
2952
2956
. push_opcode ( opcodes:: All :: OP_RETURN )
2953
2957
. push_slice ( & op_bytes)
@@ -3058,29 +3062,6 @@ mod tests {
3058
3062
}
3059
3063
}
3060
3064
3061
- pub fn txout_opreturn_v2 < T : StacksMessageCodec > (
3062
- op : & T ,
3063
- magic : & MagicBytes ,
3064
- value : u64 ,
3065
- ) -> TxOut {
3066
- let op_bytes = {
3067
- let mut buffer = vec ! [ ] ;
3068
- let mut magic_bytes = magic. as_bytes ( ) . to_vec ( ) ;
3069
- buffer. append ( & mut magic_bytes) ;
3070
- op. consensus_serialize ( & mut buffer)
3071
- . expect ( "FATAL: invalid operation" ) ;
3072
- buffer
3073
- } ;
3074
-
3075
- TxOut {
3076
- value,
3077
- script_pubkey : Builder :: new ( )
3078
- . push_opcode ( opcodes:: All :: OP_RETURN )
3079
- . push_slice ( & op_bytes)
3080
- . into_script ( ) ,
3081
- }
3082
- }
3083
-
3084
3065
pub fn create_templated_pre_stx_op ( ) -> PreStxOp {
3085
3066
PreStxOp {
3086
3067
output : StacksAddress :: p2pkh_from_hash ( false , Hash160 :: from_data ( & [ 2u8 ; 20 ] ) ) ,
@@ -3569,7 +3550,7 @@ mod tests {
3569
3550
let input_0 = utils:: txin_at_index ( & tx, & op_signer, & used_utxos, 0 ) ;
3570
3551
assert_eq ! ( input_0, tx. input[ 0 ] ) ;
3571
3552
3572
- let op_return = utils:: txout_opreturn ( & commit_op, & config. burnchain . magic_bytes ) ;
3553
+ let op_return = utils:: txout_opreturn ( & commit_op, & config. burnchain . magic_bytes , 5_500 ) ;
3573
3554
let op_commit_1 = utils:: txout_opdup_commit_to ( & commit_op. commit_outs [ 0 ] , 55_000 ) ;
3574
3555
let op_commit_2 = utils:: txout_opdup_commit_to ( & commit_op. commit_outs [ 1 ] , 55_000 ) ;
3575
3556
let op_change = utils:: txout_opdup_change_legacy ( & mut op_signer, 4_999_865_300 ) ;
@@ -3736,7 +3717,7 @@ mod tests {
3736
3717
let input_0 = utils:: txin_at_index ( & rbf_tx, & op_signer, & used_utxos, 0 ) ;
3737
3718
assert_eq ! ( input_0, rbf_tx. input[ 0 ] ) ;
3738
3719
3739
- let op_return = utils:: txout_opreturn ( & commit_op, & config. burnchain . magic_bytes ) ;
3720
+ let op_return = utils:: txout_opreturn ( & commit_op, & config. burnchain . magic_bytes , 5_500 ) ;
3740
3721
let op_commit_1 = utils:: txout_opdup_commit_to ( & commit_op. commit_outs [ 0 ] , 55_005 ) ;
3741
3722
let op_commit_2 = utils:: txout_opdup_commit_to ( & commit_op. commit_outs [ 1 ] , 55_005 ) ;
3742
3723
let op_change = utils:: txout_opdup_change_legacy ( & mut signer, 4_999_730_590 ) ;
@@ -3801,7 +3782,7 @@ mod tests {
3801
3782
let input_0 = utils:: txin_at_index ( & rbf_tx, & op_signer, & used_utxos, 0 ) ;
3802
3783
assert_eq ! ( input_0, rbf_tx. input[ 0 ] ) ;
3803
3784
3804
- let op_return = utils:: txout_opreturn ( & commit_op, & config. burnchain . magic_bytes ) ;
3785
+ let op_return = utils:: txout_opreturn ( & commit_op, & config. burnchain . magic_bytes , 5_500 ) ;
3805
3786
let op_commit_1 = utils:: txout_opdup_commit_to ( & commit_op. commit_outs [ 0 ] , 55_005 ) ;
3806
3787
let op_commit_2 = utils:: txout_opdup_commit_to ( & commit_op. commit_outs [ 1 ] , 55_005 ) ;
3807
3788
let op_change = utils:: txout_opdup_change_legacy ( & mut signer, 4_999_862_985 ) ;
@@ -3955,7 +3936,7 @@ mod tests {
3955
3936
assert_eq ! ( input_0, tx. input[ 0 ] ) ;
3956
3937
3957
3938
let op_return =
3958
- utils:: txout_opreturn_v2 ( & leader_key_op, & config. burnchain . magic_bytes , 0 ) ;
3939
+ utils:: txout_opreturn ( & leader_key_op, & config. burnchain . magic_bytes , 0 ) ;
3959
3940
let op_change = utils:: txout_opdup_change_legacy ( & mut op_signer, 4_999_980_000 ) ;
3960
3941
assert_eq ! ( op_return, tx. output[ 0 ] ) ;
3961
3942
assert_eq ! ( op_change, tx. output[ 1 ] ) ;
@@ -4123,7 +4104,7 @@ mod tests {
4123
4104
let input_0 = utils:: txin_at_index ( & tx, & op_signer, & used_utxos, 0 ) ;
4124
4105
assert_eq ! ( input_0, tx. input[ 0 ] ) ;
4125
4106
4126
- let op_return = utils:: txout_opreturn_v2 ( & pre_stx_op, & config. burnchain . magic_bytes , 0 ) ;
4107
+ let op_return = utils:: txout_opreturn ( & pre_stx_op, & config. burnchain . magic_bytes , 0 ) ;
4127
4108
let op_change = utils:: txout_opdup_change_legacy ( & mut op_signer, 24_500 ) ;
4128
4109
assert_eq ! ( op_return, tx. output[ 0 ] ) ;
4129
4110
assert_eq ! ( op_change, tx. output[ 1 ] ) ;
0 commit comments