-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description <!--- Describe your changes --> To-Do: - [x] update epoch_params section to include new governance params - [x] Add `deposit` field to `account_info` (could park to future patch) - [x] Add `delegated_drep` field to `account_info` - [x] Introduce governance section (add compatibility with BF endpoints where possible for redundancy from lib providers pov) - [x] /committee_info - [x] /committee_votes - [x] /drep_list - [x] /drep_delegators - [x] /drep_info - [x] /drep_metadata - [x] /drep_updates - [x] /drep_votes - [x] /drep_epoch_summary - [x] /proposal_list - [x] /proposal_votes - [x] /pool_votes - [x] Extend existing endpoints to include governance information (could park to future patch): - [x] /tx_info - [x] Make `bytecode` optional in tx_info, closes #293 - [x] Update `tx_info` to include various toggles in input (similar to `block_tx_info` , and in addition `_bytecode`) - [x] Update `block_tx_info` to include `_bytecode` toggle - [x] Update `block_tx_info` and `tx_info` to include `treasury_donation` field - [x] Add `tx_cbor` endpoint - [ ] Add `tx_cbor2json` endpoint (could park to future patch) - [x] Change how pool metadata is handled. Remove all metadata fields from pool_info_cache and query data live in endpoints - [x] Add Bech32 decode/encoder PG extension - [ ] Implement [CIP-129](https://github.com/cardano-foundation/CIPs/pull/857/files) (Dependent on PG B32 extension), utility and extensions are done , but their usage in endpoints parked for next [beta] release) --------- Co-authored-by: Ola <[email protected]> Co-authored-by: hodlonaut <greg@_HOSTNAME_> Co-authored-by: Greg B <[email protected]> Co-authored-by: Greg Beresnev <[email protected]> Co-authored-by: KoT_B_KocMoce <[email protected]>
- Loading branch information
1 parent
b75ab23
commit 41bcff5
Showing
41 changed files
with
7,239 additions
and
1,406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
CREATE INDEX IF NOT EXISTS pool_stat_pool_hash_id ON pool_stat(pool_hash_id); | ||
CREATE INDEX IF NOT EXISTS pool_stat_epoch_no ON pool_stat(epoch_no); | ||
CREATE INDEX IF NOT EXISTS pool_stat_epoch_no ON pool_stat(epoch_no); | ||
CREATE INDEX IF NOT EXISTS idx_drep_hash_view ON drep_hash (view); | ||
CREATE INDEX IF NOT EXISTS idx_reward_rest_addr_id ON reward_rest (addr_id); | ||
CREATE INDEX IF NOT EXISTS idx_reward_rest_spendable_epoch ON reward_rest (spendable_epoch); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
-- Binary format | ||
-- 1 byte variable length | ||
-- <------> <-------------------> | ||
-- ┌────────┬─────────────────────┐ | ||
-- │ header │ key │ | ||
-- └────────┴─────────────────────┘ | ||
-- 🔎 | ||
-- ╎ 7 6 5 4 3 2 1 0 | ||
-- ╎ ┌─┬─┬─┬─┬─┬─┬─┬─┐ | ||
-- ╰╌╌╌╌╌╌╌╌ |t│t│t│t│c│c│c│c│ | ||
-- └─┴─┴─┴─┴─┴─┴─┴─┘ | ||
-- | ||
-- Key Type (`t t t t . . . .`) | Key | ||
-- --- | --- | ||
-- `0000....` | CC Hot | ||
-- `0001....` | CC Cold | ||
-- `0010....` | DRep | ||
-- | ||
-- Credential Type (`. . . . c c c c`) | Semantic | ||
-- --- | --- | ||
-- `....0010` | Key Hash | ||
-- `....0011` | Script Hash | ||
|
||
CREATE OR REPLACE FUNCTION grest.cip129_cc_hot_to_hex(_cc_hot text) | ||
RETURNS bytea | ||
LANGUAGE plpgsql STABLE | ||
AS $$ | ||
BEGIN | ||
IF LENGTH(_cc_hot) = 60 THEN | ||
RETURN substring(b32_decode(_cc_hot) from 2); | ||
ELSE | ||
RETURN b32_decode(_cc_hot); | ||
END IF; | ||
END; | ||
$$; | ||
|
||
CREATE OR REPLACE FUNCTION grest.cip129_hex_to_cc_hot(_raw bytea, _is_script boolean) | ||
RETURNS text | ||
LANGUAGE plpgsql STABLE | ||
AS $$ | ||
BEGIN | ||
IF _is_script THEN | ||
RETURN b32_encode('cc_hot', ('\x03'::bytea || _raw)::text); | ||
ELSE | ||
RETURN b32_encode('cc_hot', ('\x02'::bytea || _raw)::text); | ||
END IF; | ||
END; | ||
$$; | ||
|
||
CREATE OR REPLACE FUNCTION grest.cip129_cc_cold_to_hex(_cc_cold text) | ||
RETURNS bytea | ||
LANGUAGE plpgsql STABLE | ||
AS $$ | ||
BEGIN | ||
IF LENGTH(_cc_cold) = 61 THEN | ||
RETURN substring(b32_decode(_cc_cold) from 2); | ||
ELSE | ||
RETURN b32_decode(_cc_cold); | ||
END IF; | ||
END; | ||
$$; | ||
|
||
CREATE OR REPLACE FUNCTION grest.cip129_hex_to_cc_cold(_raw bytea, _is_script boolean) | ||
RETURNS text | ||
LANGUAGE plpgsql STABLE | ||
AS $$ | ||
BEGIN | ||
IF _is_script THEN | ||
RETURN b32_encode('cc_cold', ('\x13'::bytea || _raw)::text); | ||
ELSE | ||
RETURN b32_encode('cc_cold', ('\x12'::bytea || _raw)::text); | ||
END IF; | ||
END; | ||
$$; | ||
|
||
CREATE OR REPLACE FUNCTION grest.cip129_drep_id_to_hex(_drep_id text) | ||
RETURNS bytea | ||
LANGUAGE plpgsql STABLE | ||
AS $$ | ||
BEGIN | ||
IF LENGTH(_drep_id) = 58 THEN | ||
RETURN substring(b32_decode(_drep_id) from 2); | ||
ELSE | ||
RETURN b32_decode(_drep_id); | ||
END IF; | ||
END; | ||
$$; | ||
|
||
CREATE OR REPLACE FUNCTION grest.cip129_hex_to_drep_id(_raw bytea, _is_script boolean) | ||
RETURNS text | ||
LANGUAGE plpgsql STABLE | ||
AS $$ | ||
BEGIN | ||
IF _is_script THEN | ||
RETURN b32_encode('drep', ('\x23'::bytea || _raw)::text); | ||
ELSE | ||
RETURN b32_encode('drep', ('\x22'::bytea || _raw)::text); | ||
END IF; | ||
END; | ||
$$; | ||
|
||
COMMENT ON FUNCTION grest.cip129_cc_hot_to_hex IS 'Returns binary hex from Constitutional Committee Hot Credential ID in old or new (CIP-129) format'; -- noqa: LT01 | ||
COMMENT ON FUNCTION grest.cip129_hex_to_cc_hot IS 'Returns Constitutional Committee Hot Credential ID in CIP-129 format from raw binary hex'; -- noqa: LT01 | ||
COMMENT ON FUNCTION grest.cip129_cc_cold_to_hex IS 'Returns binary hex from Constitutional Committee Cold Credential ID in old or new (CIP-129) format'; -- noqa: LT01 | ||
COMMENT ON FUNCTION grest.cip129_hex_to_cc_cold IS 'Returns Constitutional Committee Cold Credential ID in CIP-129 format from raw binary hex'; -- noqa: LT01 | ||
COMMENT ON FUNCTION grest.cip129_drep_id_to_hex IS 'Returns binary hex from DRep Credential ID in old or new (CIP-129) format'; -- noqa: LT01 | ||
COMMENT ON FUNCTION grest.cip129_hex_to_drep_id IS 'Returns DRep Credential ID in CIP-129 format from raw binary hex'; -- noqa: LT01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.