Skip to content
Snippets Groups Projects
Commit e5b87f6c authored by Krzysztof Leśniak's avatar Krzysztof Leśniak Committed by Bartek Wrona
Browse files

Implement cast from operation to collateralized_convert_operation

parent 334f5b09
No related branches found
No related tags found
6 merge requests!627merge in fix for get_current_block_age,!626Fix get_current_block_age function to avoid healthcheck fails,!622merge develop to master,!599merge ( with merge commit) develop to master,!597Merge develop to master for release,!264Implement conversion functions from custom operation type to specific sql operation type
......@@ -490,4 +490,11 @@ extern "C"
_operation* op = PG_GETARG_HIVE_OPERATION_PP( 0 );
return operation_to<hive::protocol::claim_reward_balance_operation>(op);
}
PG_FUNCTION_INFO_V1( operation_to_collateralized_convert_operation );
Datum operation_to_collateralized_convert_operation( PG_FUNCTION_ARGS )
{
_operation* op = PG_GETARG_HIVE_OPERATION_PP( 0 );
return operation_to<hive::protocol::collateralized_convert_operation>(op);
}
}
......@@ -137,3 +137,13 @@ AS 'MODULE_PATHNAME',
CREATE CAST (hive.operation AS hive.claim_reward_balance_operation)
WITH FUNCTION hive._operation_to_claim_reward_balance_operation
AS ASSIGNMENT;
CREATE OR REPLACE FUNCTION hive._operation_to_collateralized_convert_operation(
hive.operation
) RETURNS hive.collateralized_convert_operation LANGUAGE c IMMUTABLE STRICT PARALLEL SAFE
AS 'MODULE_PATHNAME',
'operation_to_collateralized_convert_operation';
CREATE CAST (hive.operation AS hive.collateralized_convert_operation)
WITH FUNCTION hive._operation_to_collateralized_convert_operation
AS ASSIGNMENT;
......@@ -194,4 +194,10 @@ CREATE TYPE hive.claim_reward_balance_operation AS (
reward_vests hive.asset
);
CREATE TYPE hive.collateralized_convert_operation AS (
owner hive.account_name_type,
requestid int8, -- uint32_t: 4 byte, but unsigned (int8)
amount hive.asset
);
CREATE TYPE hive.void_t AS ();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment