unpack from vector should be implemented in hive fork manager
get_witnesses()
method of haf block explorer will use haf data.
In order to derive feed_price
, url
, signing_key
, block_size
from witness_set_properties_operation
, stored procedure hive.unpack_from_vector(_vector)
should take single text parameter and decode it.
Example: the hbd_exchange_rate
value, "15020000000000000353424400000000e80300000000000003535445454d0000"
:
{
"type": "witness_set_properties_operation",
"value": {
"owner": "ocd-witness",
"props": [
[
"hbd_exchange_rate",
"15020000000000000353424400000000e80300000000000003535445454d0000"
],
[
"key",
"039e1eb02f05fad2ddec7d10743e1566f927fa89fef3fbab255fa1ea276053ce3b"
]
],
"extensions": []
}
}
should be returned as decoded price
object with nested base
and quote
, i.e. same JSON format as exchange_rate
object of feed_publish_operation
{
"type": "feed_publish_operation",
"value": {
"publisher": "pharesim",
"exchange_rate": {
"base": {
"amount": "540",
"precision": 3,
"nai": "@@000000013"
},
"quote": {
"amount": "1300",
"precision": 3,
"nai": "@@000000021"
}
}
}
}
This should work for all vectors in props
of witness_set_properties_operation
, regardless of their name
{
"type": "witness_set_properties_operation",
"value": {
"owner": "chisdealhd",
"props": [
[
"account_creation_fee",
"b80b00000000000003535445454d0000"
],
[
"account_subsidy_budget",
"1d030000"
],
[
"account_subsidy_decay",
"b94c0500"
],
[
"hbd_interest_rate",
"dc05"
],
[
"key",
"02d912ebc6358fe5b7d86964b9714b5e4d04c2d537c6f6305a2cdfcc22a0b0dc47"
],
[
"maximum_block_size",
"00000100"
],
[
"new_signing_key",
"000000000000000000000000000000000000000000000000000000000000000000"
],
[
"url",
"5b68747470733a2f2f7065616b642e636f6d2f686976652d3131313131312f4073686d6f6f676c656f73756b616d692f68656c702d737570706f72742d636869736465616c6864732d686976652d7769746e6573732d736572766572"
]
],
"extensions": []
}
}
Edited by Kristupas Bobraitis