-
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.
Move utilities to 000 instead of 03 (as 00 has dependent objects), an…
…d some more fixes
- Loading branch information
Showing
22 changed files
with
49 additions
and
55 deletions.
There are no files selected for viewing
File renamed without changes.
36 changes: 18 additions & 18 deletions
36
files/grest/rpc/03_utilities/cip5.sql → files/grest/rpc/000_utilities/cip5.sql
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,19 +1,19 @@ | ||
-- CIP References | ||
-- 0005: Common bech32 prefixes https://cips.cardano.org/cip/CIP-0005 | ||
-- 0019: Cardano Addresses https://cips.cardano.org/cip/CIP-0019 | ||
|
||
CREATE OR REPLACE FUNCTION grest.cip5_hex_to_stake_addr(_raw bytea) | ||
RETURNS text | ||
LANGUAGE plpgsql STABLE | ||
AS $$ | ||
BEGIN | ||
IF _raw IS NULL THEN | ||
RETURN NULL; | ||
END IF; | ||
IF SUBSTRING(ENCODE(_raw, 'hex') from 2 for 1) = '0' THEN | ||
RETURN b32_encode('stake_test', _raw::text); | ||
ELSE | ||
RETURN b32_encode('stake', _raw::text); | ||
END IF; | ||
END; | ||
-- CIP References | ||
-- 0005: Common bech32 prefixes https://cips.cardano.org/cip/CIP-0005 | ||
-- 0019: Cardano Addresses https://cips.cardano.org/cip/CIP-0019 | ||
|
||
CREATE OR REPLACE FUNCTION grest.cip5_hex_to_stake_addr(_raw bytea) | ||
RETURNS text | ||
LANGUAGE plpgsql STABLE | ||
AS $$ | ||
BEGIN | ||
IF _raw IS NULL THEN | ||
RETURN NULL; | ||
END IF; | ||
IF SUBSTRING(ENCODE(_raw, 'hex') from 2 for 1) = '0' THEN | ||
RETURN b32_encode('stake_test', _raw::text); | ||
ELSE | ||
RETURN b32_encode('stake', _raw::text); | ||
END IF; | ||
END; | ||
$$; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
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
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
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