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

Implement cast from operation to create_proposal_operation

parent fbd69559
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
......@@ -877,4 +877,11 @@ extern "C"
_operation* op = PG_GETARG_HIVE_OPERATION_PP( 0 );
return operation_to<hive::protocol::witness_update_operation>(op);
}
PG_FUNCTION_INFO_V1( operation_to_create_proposal_operation );
Datum operation_to_create_proposal_operation( PG_FUNCTION_ARGS )
{
_operation* op = PG_GETARG_HIVE_OPERATION_PP( 0 );
return operation_to<hive::protocol::create_proposal_operation>(op);
}
}
......@@ -447,3 +447,13 @@ AS 'MODULE_PATHNAME',
CREATE CAST (hive.operation AS hive.witness_update_operation)
WITH FUNCTION hive._operation_to_witness_update_operation
AS ASSIGNMENT;
CREATE OR REPLACE FUNCTION hive._operation_to_create_proposal_operation(
hive.operation
) RETURNS hive.create_proposal_operation LANGUAGE c IMMUTABLE STRICT PARALLEL SAFE
AS 'MODULE_PATHNAME',
'operation_to_create_proposal_operation';
CREATE CAST (hive.operation AS hive.create_proposal_operation)
WITH FUNCTION hive._operation_to_create_proposal_operation
AS ASSIGNMENT;
......@@ -465,4 +465,15 @@ CREATE TYPE hive.witness_update_operation AS (
fee hive.asset
);
CREATE TYPE hive.create_proposal_operation AS (
creator hive.account_name_type,
receiver hive.account_name_type,
start_date timestamp,
end_date timestamp,
daily_pay hive.asset,
subject TEXT,
permlink TEXT,
extensions hive.extensions_type
);
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