diff --git a/files/grest/rpc/01_cached_tables/active_stake_cache.sql b/files/grest/rpc/01_cached_tables/active_stake_cache.sql index 70ef150e..e77dd3eb 100644 --- a/files/grest/rpc/01_cached_tables/active_stake_cache.sql +++ b/files/grest/rpc/01_cached_tables/active_stake_cache.sql @@ -91,7 +91,10 @@ BEGIN epoch_stake.epoch_no, SUM(epoch_stake.amount) AS amount FROM public.epoch_stake - WHERE epoch_stake.epoch_no >= _last_active_stake_validated_epoch + WHERE epoch_stake.epoch_no >= COALESCE( + (SELECT last_value::integer + FROM grest.control_table + WHERE key = 'last_active_stake_validated_epoch'), 0) AND epoch_stake.epoch_no <= _epoch_no GROUP BY epoch_stake.epoch_no ON CONFLICT (epoch_no) DO UPDATE diff --git a/files/grest/rpc/transactions/tx_info.sql b/files/grest/rpc/transactions/tx_info.sql index fd598d23..3804de08 100644 --- a/files/grest/rpc/transactions/tx_info.sql +++ b/files/grest/rpc/transactions/tx_info.sql @@ -276,7 +276,7 @@ BEGIN ) END ) AS reference_script, - REPLACE(tx_out.multi_assets_descr,'fromList ','')::jsonb AS asset_descr + REPLACE(tx_out.multi_assets_descr,'fromList ','')::text[] AS asset_descr FROM collateral_tx_out AS tx_out INNER JOIN tx ON tx_out.tx_id = tx.id