File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
zebra-consensus/src/transaction Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -1249,6 +1249,40 @@ fn v5_coinbase_transaction_with_enable_spends_flag_fails_validation() {
12491249 }
12501250}
12511251
1252+ #[ cfg( all( zcash_unstable = "nu7" , feature = "tx_v6" ) ) ]
1253+ #[ test]
1254+ fn v6_coinbase_transaction_with_enable_zsa_flag_fails_validation ( ) {
1255+ let network = Network :: new_regtest (
1256+ ConfiguredActivationHeights {
1257+ canopy : Some ( 1 ) ,
1258+ nu7 : Some ( 1 ) ,
1259+ ..Default :: default ( )
1260+ }
1261+ . into ( ) ,
1262+ ) ;
1263+
1264+ let outputs = vec ! [ ( Amount :: zero( ) , transparent:: Script :: new( Default :: default ( ) ) ) ] ;
1265+
1266+ let mut tx = Transaction :: new_v6_coinbase (
1267+ & network,
1268+ Height ( 1 ) ,
1269+ outputs,
1270+ Vec :: new ( ) ,
1271+ Some ( Amount :: zero ( ) ) ,
1272+ ) ;
1273+
1274+ let shielded_data = insert_fake_v6_orchard_shielded_data ( & mut tx) ;
1275+
1276+ assert ! ( !shielded_data. flags. contains( Flags :: ENABLE_ZSA ) ) ;
1277+
1278+ shielded_data. flags = Flags :: ENABLE_ZSA ;
1279+
1280+ assert_eq ! (
1281+ check:: coinbase_tx_no_prevout_joinsplit_spend( & tx) ,
1282+ Err ( TransactionError :: CoinbaseHasEnableZSA )
1283+ ) ;
1284+ }
1285+
12521286#[ tokio:: test]
12531287async fn v5_transaction_is_rejected_before_nu5_activation ( ) {
12541288 let sapling = NetworkUpgrade :: Sapling ;
You can’t perform that action at this time.
0 commit comments