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

Implement cast from operation to author_reward_operation

parent e20aba63
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
......@@ -977,4 +977,11 @@ extern "C"
_operation* op = PG_GETARG_HIVE_OPERATION_PP( 0 );
return operation_to<hive::protocol::account_created_operation>(op);
}
PG_FUNCTION_INFO_V1( operation_to_author_reward_operation );
Datum operation_to_author_reward_operation( PG_FUNCTION_ARGS )
{
_operation* op = PG_GETARG_HIVE_OPERATION_PP( 0 );
return operation_to<hive::protocol::author_reward_operation>(op);
}
}
......@@ -507,3 +507,13 @@ AS 'MODULE_PATHNAME',
CREATE CAST (hive.operation AS hive.account_created_operation)
WITH FUNCTION hive._operation_to_account_created_operation
AS ASSIGNMENT;
CREATE OR REPLACE FUNCTION hive._operation_to_author_reward_operation(
hive.operation
) RETURNS hive.author_reward_operation LANGUAGE c IMMUTABLE STRICT PARALLEL SAFE
AS 'MODULE_PATHNAME',
'operation_to_author_reward_operation';
CREATE CAST (hive.operation AS hive.author_reward_operation)
WITH FUNCTION hive._operation_to_author_reward_operation
AS ASSIGNMENT;
......@@ -522,4 +522,14 @@ CREATE TYPE hive.account_created_operation AS (
initial_delegation hive.asset
);
CREATE TYPE hive.author_reward_operation AS (
author hive.account_name_type,
permlink hive.permlink,
hbd_payout hive.asset,
hive_payout hive.asset,
vesting_payout hive.asset,
curators_vesting_payout hive.asset,
payout_must_be_claimed boolean
);
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