forked from lthn/blockchain
fixed bugs in ado transition
This commit is contained in:
parent
42b5f32116
commit
aeb313a72c
2 changed files with 6 additions and 17 deletions
|
|
@ -123,13 +123,13 @@ struct asset_descriptor_operation_v1
|
||||||
asset_descriptor_base descriptor;
|
asset_descriptor_base descriptor;
|
||||||
crypto::public_key amount_commitment = currency::null_pkey; // premultiplied by 1/8
|
crypto::public_key amount_commitment = currency::null_pkey; // premultiplied by 1/8
|
||||||
boost::optional<crypto::public_key> opt_asset_id; // target asset_id - for update/emit
|
boost::optional<crypto::public_key> opt_asset_id; // target asset_id - for update/emit
|
||||||
uint8_t verion = 1;
|
uint8_t verion = ASSET_DESCRIPTOR_OPERATION_HF4_VER;
|
||||||
|
|
||||||
BEGIN_VERSIONED_SERIALIZE(1, verion)
|
BEGIN_SERIALIZE()
|
||||||
FIELD(operation_type)
|
FIELD(operation_type)
|
||||||
FIELD(descriptor)
|
FIELD(descriptor)
|
||||||
FIELD(amount_commitment)
|
FIELD(amount_commitment)
|
||||||
END_VERSION_UNDER(1)
|
//END_VERSION_UNDER(1)
|
||||||
FIELD(opt_asset_id)
|
FIELD(opt_asset_id)
|
||||||
END_SERIALIZE()
|
END_SERIALIZE()
|
||||||
|
|
||||||
|
|
@ -139,7 +139,7 @@ struct asset_descriptor_operation_v1
|
||||||
BOOST_SERIALIZE(operation_type)
|
BOOST_SERIALIZE(operation_type)
|
||||||
BOOST_SERIALIZE(descriptor)
|
BOOST_SERIALIZE(descriptor)
|
||||||
BOOST_SERIALIZE(amount_commitment)
|
BOOST_SERIALIZE(amount_commitment)
|
||||||
BOOST_END_VERSION_UNDER(1)
|
//BOOST_END_VERSION_UNDER(1)
|
||||||
BOOST_SERIALIZE(opt_asset_id)
|
BOOST_SERIALIZE(opt_asset_id)
|
||||||
END_BOOST_SERIALIZATION()
|
END_BOOST_SERIALIZATION()
|
||||||
};
|
};
|
||||||
|
|
@ -183,7 +183,7 @@ bool transition_convert(const asset_descriptor_operation_v1& from, asset_descrip
|
||||||
to.operation_type = from.operation_type;
|
to.operation_type = from.operation_type;
|
||||||
to.opt_descriptor = from.descriptor;
|
to.opt_descriptor = from.descriptor;
|
||||||
to.opt_amount_commitment = from.amount_commitment;
|
to.opt_amount_commitment = from.amount_commitment;
|
||||||
to.opt_asset_id = to.opt_asset_id; // target asset_id - for update/emit
|
to.opt_asset_id = from.opt_asset_id; // target asset_id - for update/emit
|
||||||
to.version = from.verion;
|
to.version = from.verion;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -5640,18 +5640,7 @@ void wallet2::update_asset(const crypto::public_key& asset_id, const currency::a
|
||||||
ctp.tx_meaning_for_logs = "asset eth update";
|
ctp.tx_meaning_for_logs = "asset eth update";
|
||||||
}
|
}
|
||||||
|
|
||||||
// old:
|
this->transfer(ctp, ft, send_to_network, nullptr);
|
||||||
//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)
|
void wallet2::update_asset(const crypto::public_key& asset_id, const currency::asset_descriptor_base new_descriptor, currency::transaction& result_tx)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue