Merge pull request #275 from hermeznetwork/feature/api-db-tests-til

Feature/api db tests til
This commit is contained in:
arnau
2020-11-11 15:54:41 +01:00
committed by GitHub
6 changed files with 298 additions and 186 deletions

View File

@@ -453,12 +453,12 @@ BEGIN
NEW.load_amount IS NULL OR
NEW.load_amount_f IS NULL OR
(NOT NEW.user_origin AND NEW.batch_num IS NULL) THEN -- If is Coordinator L1, must include batch_num
RAISE EXCEPTION 'Invalid L1 tx.';
RAISE EXCEPTION 'Invalid L1 tx: %', NEW;
END IF;
ELSE
-- Validate
IF NEW.batch_num IS NULL OR NEW.nonce IS NULL THEN
RAISE EXCEPTION 'Invalid L2 tx.';
RAISE EXCEPTION 'Invalid L2 tx: %', NEW;
END IF;
-- Set fee if it's null
IF NEW.fee IS NULL THEN