mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 11:18:01 +00:00
fix: verify-deposit blockchain verification and wallet-based auth
- Drop auth.users FK constraints for wallet-based authentication - Fix deferrable unique constraint on blockchain_tx_hash (ON CONFLICT compat) - Rewrite block search: HTTP RPC + blake2b instead of WS-only @pezkuwi/api - Add blockNumber hint for faster verification of older transactions - Normalize SS58/hex addresses via base58 for reliable comparison - DepositModal captures approximate block number after tx submission
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
-- Fix: Make blockchain_tx_hash unique constraint non-deferrable
|
||||
-- PostgreSQL ON CONFLICT does not support deferrable constraints as arbiters
|
||||
|
||||
-- Drop the deferrable constraint (actual name from migration 016)
|
||||
ALTER TABLE public.p2p_deposit_withdraw_requests
|
||||
DROP CONSTRAINT IF EXISTS p2p_deposit_withdraw_requests_tx_hash_unique;
|
||||
|
||||
-- Also try the auto-generated name pattern
|
||||
ALTER TABLE public.p2p_deposit_withdraw_requests
|
||||
DROP CONSTRAINT IF EXISTS unique_blockchain_tx_hash;
|
||||
|
||||
-- Also try the default PostgreSQL naming convention
|
||||
ALTER TABLE public.p2p_deposit_withdraw_requests
|
||||
DROP CONSTRAINT IF EXISTS p2p_deposit_withdraw_requests_blockchain_tx_hash_key;
|
||||
|
||||
-- Recreate as non-deferrable (standard UNIQUE)
|
||||
ALTER TABLE public.p2p_deposit_withdraw_requests
|
||||
ADD CONSTRAINT p2p_deposit_withdraw_requests_tx_hash_unique UNIQUE (blockchain_tx_hash);
|
||||
Reference in New Issue
Block a user