libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 8f0150372b98d2bd9087c84c564fc7d6c0bb3a57
parent fd819d84c2589baf6ade95ea41bee7aa7f99169f
Author: Antoine A <>
Date:   Tue, 17 Oct 2023 07:29:29 +0000

Fix procedures.sql

Diffstat:
Mdatabase-versioning/procedures.sql | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/database-versioning/procedures.sql b/database-versioning/procedures.sql @@ -1,9 +1,9 @@ BEGIN; SET search_path TO libeufin_bank; -CREATE OR REPLACE FUNCTION amount_normalize( +CREATE OR REPLACE PROCEDURE amount_normalize( IN amount taler_amount - ,OUT normalized taler_amount + ,INOUT normalized taler_amount ) LANGUAGE plpgsql AS $$ @@ -11,13 +11,13 @@ BEGIN normalized.val = amount.val + amount.frac / 100000000; normalized.frac = amount.frac % 100000000; END $$; -COMMENT ON FUNCTION amount_normalize +COMMENT ON PROCEDURE amount_normalize IS 'Returns the normalized amount by adding to the .val the value of (.frac / 100000000) and removing the modulus 100000000 from .frac.'; -CREATE OR REPLACE FUNCTION amount_add( +CREATE OR REPLACE PROCEDURE amount_add( IN a taler_amount ,IN b taler_amount - ,OUT sum taler_amount + ,INOUT sum taler_amount ) LANGUAGE plpgsql AS $$ @@ -29,7 +29,7 @@ BEGIN RAISE EXCEPTION 'addition overflow'; END IF; END $$; -COMMENT ON FUNCTION amount_add +COMMENT ON PROCEDURE amount_add IS 'Returns the normalized sum of two amounts. It raises an exception when the resulting .val is larger than 2^52'; CREATE OR REPLACE FUNCTION amount_left_minus_right(