A body in queries still is treated as `text`, but the newest HAF changes introduced a new type: `hive.operation` for a body field.
For:
curl -s -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0", "method":"account_history_api.get_account_history", "params":{"account":"anton333", "start":-1, "limit":10}, "id":1}'
we get:
{
"hint": null,
"details": null,
"code": "42804",
"message": "CASE types hive.operation and text cannot be matched"
}
For SQL query:
select * from hafah_endpoints.call_get_account_history('{"account":"anton333", "start":-1, "limit":10}', 'object')
we get
ERROR: CASE types hive.operation and text cannot be matched
LINE 20: WHEN _is_legacy_style THEN hive.get_legacy_style_o...
^
QUERY: SELECT -- hafah_python.ah_get_account_history
(
CASE
WHEN ho.trx_in_block < 0 THEN '0000000000000000000000000000000000000000'
ELSE encode( (SELECT htv.trx_hash FROM hive.transactions_view htv WHERE ho.trx_in_block >= 0 AND ds.block_num = htv.block_num AND ho.trx_in_block = htv.trx_in_block), 'hex')
END
) AS _trx_id,
ds.block_num AS _block,
(
CASE
WHEN ho.trx_in_block < 0 THEN 4294967295
ELSE ho.trx_in_block
END
) AS _trx_in_block,
ho.op_pos::BIGINT AS _op_in_trx,
hot.is_virtual AS virtual_op,
btrim(to_json(ho."timestamp")::TEXT, '"'::TEXT) AS formated_timestamp,
(
CASE
WHEN _is_legacy_style THEN hive.get_legacy_style_operation(ho.body)::TEXT
ELSE ho.body
END
) AS _value,
ds.account_op_seq_no AS _operation_id
FROM
...
Edited by Mariusz Trela