forked from lthn/blockchain
fxed arguments order for cast_assign_a_to_b()
This commit is contained in:
parent
37e62ac079
commit
9d06106a78
3 changed files with 7 additions and 9 deletions
|
|
@ -84,9 +84,9 @@ namespace misc_utils
|
|||
{
|
||||
|
||||
template<typename t_type_a, typename t_type_b>
|
||||
void cast_assign_a_to_b(t_type_a& a, const t_type_b& b)
|
||||
void cast_assign_a_to_b(const t_type_a& a, t_type_b& b)
|
||||
{
|
||||
*static_cast<t_type_b*>(&a) = b;
|
||||
*static_cast<t_type_a*>(&b) = a;
|
||||
}
|
||||
|
||||
template<class _Ty1,
|
||||
|
|
|
|||
|
|
@ -548,7 +548,7 @@ namespace currency
|
|||
{
|
||||
assets_list.push_back(currency::asset_descriptor_with_id());
|
||||
assets_list.back().asset_id = pr.first;
|
||||
epee::misc_utils::cast_assign_a_to_b(assets_list.back(), static_cast<currency::asset_descriptor_base>(pr.second));
|
||||
epee::misc_utils::cast_assign_a_to_b(static_cast<currency::asset_descriptor_base>(pr.second), assets_list.back());
|
||||
//*static_cast<currency::asset_descriptor_base*>(&assets_list.back()) = pr.second;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -403,8 +403,7 @@ void wallet2::process_ado_in_new_transaction(const currency::asset_descriptor_op
|
|||
|
||||
WLT_THROW_IF_FALSE_WALLET_CMN_ERR_EX(m_own_asset_descriptors.count(asset_id) == 0, "asset with asset_id " << asset_id << " has already been registered in the wallet as own asset");
|
||||
wallet_own_asset_context& asset_context = m_own_asset_descriptors[asset_id];
|
||||
epee::misc_utils::cast_assign_a_to_b(asset_context, ado.descriptor);
|
||||
//*static_cast<asset_descriptor_base*>(&asset_context) = ado.descriptor;
|
||||
epee::misc_utils::cast_assign_a_to_b(ado.descriptor, asset_context);
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "New Asset Registered:"
|
||||
|
|
@ -428,7 +427,7 @@ void wallet2::process_ado_in_new_transaction(const currency::asset_descriptor_op
|
|||
break;
|
||||
//asset had been updated
|
||||
add_rollback_event(ptc.height, asset_update_event{ it->first, it->second });
|
||||
epee::misc_utils::cast_assign_a_to_b(it->second, ado.descriptor);
|
||||
epee::misc_utils::cast_assign_a_to_b(ado.descriptor, it->second);
|
||||
|
||||
}
|
||||
else if (ado.operation_type == ASSET_DESCRIPTOR_OPERATION_UPDATE )
|
||||
|
|
@ -441,7 +440,7 @@ void wallet2::process_ado_in_new_transaction(const currency::asset_descriptor_op
|
|||
// ownership of the asset acquired
|
||||
|
||||
wallet_own_asset_context& asset_context = m_own_asset_descriptors[asset_id];
|
||||
epee::misc_utils::cast_assign_a_to_b(asset_context, ado.descriptor);
|
||||
epee::misc_utils::cast_assign_a_to_b(ado.descriptor, asset_context);
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Asset ownership acquired:"
|
||||
|
|
@ -492,8 +491,7 @@ void wallet2::process_ado_in_new_transaction(const currency::asset_descriptor_op
|
|||
{
|
||||
//just an update of the asset
|
||||
add_rollback_event(ptc.height, asset_update_event{ it->first, it->second });
|
||||
epee::misc_utils::cast_assign_a_to_b(it->second, ado.descriptor);
|
||||
|
||||
epee::misc_utils::cast_assign_a_to_b(ado.descriptor, it->second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue