<commit_before>-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pg_blkchain" to load this file. \quit

CREATE FUNCTION verify_sig(bytea, bytea, int) RETURNS bool
AS '$libdir/pg_blkchain'
LANGUAGE C IMMUTABLE STRICT;

CREATE TYPE Tx AS (hash BYTEA, version BIGINT, locktime BIGINT);
CREATE FUNCTION get_tx(bytea) RETURNS Tx
AS '$libdir/pg_blkchain'
LANGUAGE C IMMUTABLE STRICT;

CREATE TYPE TxIn AS (n INT, prevout_hash BYTEA, prevout_n INT, scriptsig BYTEA, sequence INT);
CREATE FUNCTION get_vin(bytea) RETURNS SETOF TxIn
AS '$libdir/pg_blkchain'
LANGUAGE C IMMUTABLE STRICT;

CREATE TYPE TxOut AS (n INT, value BIGINT, scriptpubkey BYTEA);
CREATE FUNCTION get_vout(bytea) RETURNS SETOF TxOut
AS '$libdir/pg_blkchain'
LANGUAGE C IMMUTABLE STRICT;

CREATE TYPE ScriptOp AS (op_sym TEXT, op INT, data BYTEA);
CREATE FUNCTION parse_script(bytea) RETURNS SETOF ScriptOp
AS '$libdir/pg_blkchain'
LANGUAGE C IMMUTABLE STRICT;

-- experimental
CREATE FUNCTION get_vout_arr(bytea) RETURNS TxOut[]
AS '$libdir/pg_blkchain'
LANGUAGE C IMMUTABLE STRICT;<commit_msg>Prepend C (for Chain?) to names to make them a little more unique<commit_after>-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pg_blkchain" to load this file. \quit


CREATE TYPE CTx AS (hash BYTEA, version BIGINT, locktime BIGINT);
CREATE FUNCTION get_tx(bytea) RETURNS CTx
AS '$libdir/pg_blkchain'
LANGUAGE C IMMUTABLE STRICT;

CREATE TYPE CTxIn AS (n INT, prevout_hash BYTEA, prevout_n INT, scriptsig BYTEA, sequence INT);
CREATE FUNCTION get_vin(bytea) RETURNS SETOF CTxIn
AS '$libdir/pg_blkchain'
LANGUAGE C IMMUTABLE STRICT;

CREATE TYPE CTxOut AS (n INT, value BIGINT, scriptpubkey BYTEA);
CREATE FUNCTION get_vout(bytea) RETURNS SETOF CTxOut
AS '$libdir/pg_blkchain'
LANGUAGE C IMMUTABLE STRICT;

CREATE TYPE CScriptOp AS (op_sym TEXT, op INT, data BYTEA);
CREATE FUNCTION parse_script(bytea) RETURNS SETOF CScriptOp
AS '$libdir/pg_blkchain'
LANGUAGE C IMMUTABLE STRICT;

CREATE FUNCTION verify_sig(bytea, bytea, int) RETURNS bool
AS '$libdir/pg_blkchain'
LANGUAGE C IMMUTABLE STRICT;

-- experimental
CREATE FUNCTION get_vout_arr(bytea) RETURNS TxOut[]
AS '$libdir/pg_blkchain'
LANGUAGE C IMMUTABLE STRICT;
{'fraction_non_alphanumeric': 0.07240017551557701, 'fraction_numerical': 0.0, 'mean_word_length': 5.909090909090909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6307082', 'n_tokens_mistral': 845, 'n_tokens_neox': 818, 'n_words': 289}