1
0
Fork 0
forked from lthn/blockchain

Fixed few bugs with emmit opertion, still not working

This commit is contained in:
cryptozoidberg 2023-08-17 21:46:37 +02:00
parent 3996567462
commit 0677548653
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
2 changed files with 4 additions and 5 deletions

View file

@ -635,7 +635,7 @@ namespace currency
crypto::point_t sum_of_pseudo_out_amount_commitments = crypto::c_point_0;
// take into account newly emitted assets
asset_descriptor_operation ado = AUTO_VAL_INIT(ado);
if (get_type_in_variant_container(tx.extra, ado) && ado.operation_type == ASSET_DESCRIPTOR_OPERATION_REGISTER) // @#@ TODO: Support other asset operations
if (get_type_in_variant_container(tx.extra, ado) && (ado.operation_type == ASSET_DESCRIPTOR_OPERATION_REGISTER || ado.operation_type == ASSET_DESCRIPTOR_OPERATION_EMMIT))
{
// opt_amount_commitment supposed to be validated earlier in validate_asset_operation()
CHECK_AND_ASSERT_MES(ado.opt_amount_commitment.has_value(), false, "opt_amount_commitment is not set");

View file

@ -333,11 +333,10 @@ namespace currency
if (!get_type_in_variant_container(tx.extra, *p_ado))
return false;
// TODO @#@# change to ASSET_DESCRIPTOR_OPERATION_EMMIT !
if (p_ado->operation_type != ASSET_DESCRIPTOR_OPERATION_REGISTER)
return false;
if (p_ado->operation_type == ASSET_DESCRIPTOR_OPERATION_REGISTER || p_ado->operation_type == ASSET_DESCRIPTOR_OPERATION_EMMIT)
return true;
return true;
return false;
}
//---------------------------------------------------------------
// Prepapres vector of output_entry to be used in key_offsets in a transaction input: