fn remove_coinbase_output_flag() {
	let keychain = ExtKeychain::from_random_seed().unwrap();
	let prev = BlockHeader::default();
	let key_id = ExtKeychain::derive_key_id(1, 1, 0, 0, 0);
	let mut b = new_block(vec![], &keychain, &prev, &key_id);

	assert!(b.outputs()[0]
		.features
		.contains(OutputFeatures::COINBASE_OUTPUT));
	b.outputs_mut()[0]
		.features
		.remove(OutputFeatures::COINBASE_OUTPUT);

	assert_eq!(b.verify_coinbase(), Err(Error::CoinbaseSumMismatch));
	assert!(b
		.verify_kernel_sums(b.header.overage(), b.header.total_kernel_offset())
		.is_ok());
	assert_eq!(
		b.validate(&BlindingFactor::zero(), verifier_cache()),
		Err(Error::CoinbaseSumMismatch)
	);
}
// test that flipping the COINBASE_OUTPUT flag on the output features
// invalidates the block and specifically it causes verify_coinbase to fail
// additionally verifying the merkle_inputs_outputs also fails
test that flipping the COINBASE_OUTPUT flag on the output features
invalidates the block and specifically it causes verify_coinbase to fail
additionally verifying the merkle_inputs_outputs also fails
test that flipping the COINBASE_OUTPUT flag on the output features invalidates the block and specifically it causes verify_coinbase to fail additionally verifying the merkle_inputs_outputs also fails
fn remove_coinbase_output_flag() {
	let keychain = ExtKeychain::from_random_seed().unwrap();
	let prev = BlockHeader::default();
	let key_id = ExtKeychain::derive_key_id(1, 1, 0, 0, 0);
	let mut b = new_block(vec![], &keychain, &prev, &key_id);
	assert!(b.outputs()[0]
		.features
		.contains(OutputFeatures::COINBASE_OUTPUT));
	b.outputs_mut()[0]
		.features
		.remove(OutputFeatures::COINBASE_OUTPUT);
	assert_eq!(b.verify_coinbase(), Err(Error::CoinbaseSumMismatch));
	assert!(b
		.verify_kernel_sums(b.header.overage(), b.header.total_kernel_offset())
		.is_ok());
	assert_eq!(
		b.validate(&BlindingFactor::zero(), verifier_cache()),
		Err(Error::CoinbaseSumMismatch)
	);
}
fn remove_coinbase_output_flag ( ) { let keychain = ExtKeychain :: from_random_seed ( ) . unwrap ( ) ; let prev = BlockHeader :: default ( ) ; let key_id = ExtKeychain :: derive_key_id ( 1 , 1 , 0 , 0 , 0 ) ; let mut b = new_block ( vec ! [ ] , & keychain , & prev , & key_id ) ; assert ! ( b outputs ( ) [ 0 ] features contains ( OutputFeatures COINBASE_OUTPUT ) ) ; b . outputs_mut ( ) [ 0 ] . features . remove ( OutputFeatures :: COINBASE_OUTPUT ) ; assert_eq ! ( b verify_coinbase ( ) Err ( Error CoinbaseSumMismatch ) ) ; assert ! ( b verify_kernel_sums ( b header overage ( ) b header total_kernel_offset ( ) ) is_ok ( ) ) ; assert_eq ! ( b validate ( BlindingFactor zero ( ) verifier_cache ( ) ) Err ( Error CoinbaseSumMismatch ) ) ; }
test that flipping the COINBASE_OUTPUT flag on the output features
invalidates the block and specifically it causes verify_coinbase to fail
additionally verifying the merkle_inputs_outputs also fails
test that flipping the COINBASE_OUTPUT flag on the output features invalidates the block and specifically it causes verify_coinbase to fail additionally verifying the merkle_inputs_outputs also fails