1
0
Fork 0
forked from lthn/blockchain

test code for wallet2::update_asset

This commit is contained in:
sowle 2024-10-21 14:21:55 +02:00
parent b2b4342c14
commit 42b5f32116
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -5640,7 +5640,18 @@ void wallet2::update_asset(const crypto::public_key& asset_id, const currency::a
ctp.tx_meaning_for_logs = "asset eth update";
}
this->transfer(ctp, ft, send_to_network, nullptr);
// old:
//this->transfer(ctp, ft, send_to_network, nullptr);
//// test code -- TODO remove this -- sowle
this->transfer(ctp, ft, false, nullptr);
crypto::hash h1 = get_transaction_hash(ft.tx);
blobdata tx_blob = t_serializable_object_to_blob(ft.tx);
transaction tx{};
parse_and_validate_tx_from_blob(tx_blob, tx);
crypto::hash h2 = get_transaction_hash(tx);
CHECK_AND_ASSERT_THROW_MES(h1 == h2, "h1 != h2");
//// end of test code
}
//----------------------------------------------------------------------------------------------------
void wallet2::update_asset(const crypto::public_key& asset_id, const currency::asset_descriptor_base new_descriptor, currency::transaction& result_tx)