From 2053498dd207955fe6abbd44ad9a0115a4d1a1e1 Mon Sep 17 00:00:00 2001 From: pk910 Date: Wed, 30 Oct 2024 10:44:20 +0100 Subject: [PATCH 1/3] fix index name collision in sql schema --- db/schema/pgsql/20240805095505_pectra-updates2.sql | 2 +- db/schema/pgsql/20241006182734_pectra-updates3.sql | 2 +- db/schema/sqlite/20240805095505_pectra-updates2.sql | 2 +- db/schema/sqlite/20241006182734_pectra-updates3.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db/schema/pgsql/20240805095505_pectra-updates2.sql b/db/schema/pgsql/20240805095505_pectra-updates2.sql index 0f67fd1..f6df667 100644 --- a/db/schema/pgsql/20240805095505_pectra-updates2.sql +++ b/db/schema/pgsql/20240805095505_pectra-updates2.sql @@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS public."consolidation_requests" ( target_index BIGINT NULL, target_pubkey bytea NULL, tx_hash bytea NULL, - CONSTRAINT consolidation_pkey PRIMARY KEY (slot_root, slot_index) + CONSTRAINT consolidation_requests_pkey PRIMARY KEY (slot_root, slot_index) ); CREATE INDEX IF NOT EXISTS "consolidation_requests_slot_idx" diff --git a/db/schema/pgsql/20241006182734_pectra-updates3.sql b/db/schema/pgsql/20241006182734_pectra-updates3.sql index 3a85324..e57686e 100644 --- a/db/schema/pgsql/20241006182734_pectra-updates3.sql +++ b/db/schema/pgsql/20241006182734_pectra-updates3.sql @@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS public."consolidation_request_txs" ( tx_sender bytea NOT NULL, tx_target bytea NOT NULL, dequeue_block BIGINT NOT NULL, - CONSTRAINT consolidation_pkey PRIMARY KEY (block_root, block_index) + CONSTRAINT consolidation_request_txs_pkey PRIMARY KEY (block_root, block_index) ); CREATE INDEX IF NOT EXISTS "consolidation_request_txs_block_number_idx" diff --git a/db/schema/sqlite/20240805095505_pectra-updates2.sql b/db/schema/sqlite/20240805095505_pectra-updates2.sql index dc92616..2bcb63e 100644 --- a/db/schema/sqlite/20240805095505_pectra-updates2.sql +++ b/db/schema/sqlite/20240805095505_pectra-updates2.sql @@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS "consolidation_requests" ( target_index BIGINT NULL, target_pubkey BLOB NULL, tx_hash BLOB NULL, - CONSTRAINT consolidation_pkey PRIMARY KEY (slot_root, slot_index) + CONSTRAINT consolidation_requests_pkey PRIMARY KEY (slot_root, slot_index) ); CREATE INDEX IF NOT EXISTS "consolidation_requests_slot_idx" diff --git a/db/schema/sqlite/20241006182734_pectra-updates3.sql b/db/schema/sqlite/20241006182734_pectra-updates3.sql index 6575383..59bfdab 100644 --- a/db/schema/sqlite/20241006182734_pectra-updates3.sql +++ b/db/schema/sqlite/20241006182734_pectra-updates3.sql @@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS "consolidation_request_txs" ( tx_sender BLOB NOT NULL, tx_target BLOB NOT NULL, dequeue_block BIGINT NOT NULL, - CONSTRAINT consolidation_pkey PRIMARY KEY (block_root, block_index) + CONSTRAINT consolidation_request_txs_pkey PRIMARY KEY (block_root, block_index) ); CREATE INDEX IF NOT EXISTS "consolidation_request_txs_block_number_idx" From e38b8b9e7c37fcbf37052d8d4bf75e118ece8dbc Mon Sep 17 00:00:00 2001 From: pk910 Date: Wed, 30 Oct 2024 11:28:22 +0100 Subject: [PATCH 2/3] fix insert query for consolidation request txs to pgsql --- db/consolidation_request_txs.go | 2 +- db/consolidation_requests.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/consolidation_request_txs.go b/db/consolidation_request_txs.go index 0566678..ca01270 100644 --- a/db/consolidation_request_txs.go +++ b/db/consolidation_request_txs.go @@ -53,7 +53,7 @@ func InsertConsolidationRequestTxs(consolidationTxs []*dbtypes.ConsolidationRequ argIdx += fieldCount } fmt.Fprint(&sql, EngineQuery(map[dbtypes.DBEngineType]string{ - dbtypes.DBEnginePgsql: " ON CONFLICT (block_number, block_index) DO UPDATE SET source_index = excluded.source_index, target_index = excluded.target_index, fork_id = excluded.fork_id", + dbtypes.DBEnginePgsql: " ON CONFLICT (block_root, block_index) DO UPDATE SET source_index = excluded.source_index, target_index = excluded.target_index, fork_id = excluded.fork_id", dbtypes.DBEngineSqlite: "", })) diff --git a/db/consolidation_requests.go b/db/consolidation_requests.go index c5f1247..a42c1fe 100644 --- a/db/consolidation_requests.go +++ b/db/consolidation_requests.go @@ -50,7 +50,7 @@ func InsertConsolidationRequests(consolidations []*dbtypes.ConsolidationRequest, argIdx += fieldCount } fmt.Fprint(&sql, EngineQuery(map[dbtypes.DBEngineType]string{ - dbtypes.DBEnginePgsql: " ON CONFLICT (slot_index, slot_root) DO UPDATE SET orphaned = excluded.orphaned, fork_id = excluded.fork_id", + dbtypes.DBEnginePgsql: " ON CONFLICT (slot_root, slot_index) DO UPDATE SET orphaned = excluded.orphaned, fork_id = excluded.fork_id", dbtypes.DBEngineSqlite: "", })) _, err := tx.Exec(sql.String(), args...) From d1f596678dcfa8e6e93fb228ec7338ea76c05ccf Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 4 Nov 2024 18:22:52 +0100 Subject: [PATCH 3/3] improve style for error dialog --- .../src/components/SubmitDepositsForm/DepositEntry.tsx | 4 ++-- .../components/SubmitDepositsForm/SubmitDepositsForm.scss | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ui-package/src/components/SubmitDepositsForm/DepositEntry.tsx b/ui-package/src/components/SubmitDepositsForm/DepositEntry.tsx index 31a7085..a9bd918 100644 --- a/ui-package/src/components/SubmitDepositsForm/DepositEntry.tsx +++ b/ui-package/src/components/SubmitDepositsForm/DepositEntry.tsx @@ -67,12 +67,12 @@ const DepositEntry = (props: IDepositEntryProps): React.ReactElement => { } {errorModal && ( - setErrorModal(null)} size="lg"> + setErrorModal(null)} size="lg" className="submit-deposit-modal"> Deposit Transaction Failed -
{errorModal}
+
{errorModal}
diff --git a/ui-package/src/components/SubmitDepositsForm/SubmitDepositsForm.scss b/ui-package/src/components/SubmitDepositsForm/SubmitDepositsForm.scss index e69de29..dcdfd30 100644 --- a/ui-package/src/components/SubmitDepositsForm/SubmitDepositsForm.scss +++ b/ui-package/src/components/SubmitDepositsForm/SubmitDepositsForm.scss @@ -0,0 +1,7 @@ + +.submit-deposit-modal { + .deposit-error { + text-wrap: wrap; + word-break: break-word; + } +}