Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = ["Heliax <hello@heliax.dev>"]
edition = "2021"
license = "GPL-3.0"
readme = "README.md"
version = "1.1.4"
version = "1.1.5"

[workspace.dependencies]
clokwerk = "0.4.0"
Expand Down Expand Up @@ -85,4 +85,4 @@ fake = { version = "2.10.0", features = ["derive"] }
rand = "0.8.5"
bigdecimal = "0.4.5"
strum = "0.26.3"
strum_macros = "0.26.3"
strum_macros = "0.26.3"
4 changes: 3 additions & 1 deletion orm/migrations/2024-12-01-170248_ibc_ack/down.sql
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
DROP TABLE IF EXISTS ibc_ack;
DROP TABLE IF EXISTS ibc_ack;

DROP TYPE IF EXISTS IBC_STATUS;
35 changes: 34 additions & 1 deletion orm/migrations/2024-12-10-104502_transaction_types/down.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
-- This file should undo anything in `up.sql`
DROP TYPE IBC_STATUS;

-- Step 1: Rename the existing enum type
ALTER TYPE TRANSACTION_KIND RENAME TO TRANSACTION_KIND_OLD;

-- Step 2: Create the new enum type without the added values
CREATE TYPE TRANSACTION_KIND AS ENUM (
'transparent_transfer',
'shielded_transfer',
'shielding_transfer',
'unshielding_transfer',
'ibc_msg_transfer',
'bond',
'redelegation',
'unbond',
'withdraw',
'claim_rewards',
'vote_proposal',
'init_proposal',
'change_metadata',
'change_commission',
'reveal_pk',
'become_validator',
'unknown'
);

-- Step 3: Update all columns to use the new enum type
ALTER TABLE inner_transactions ALTER COLUMN kind TYPE TRANSACTION_KIND
USING kind::text::TRANSACTION_KIND;

ALTER TABLE gas ALTER COLUMN tx_kind TYPE TRANSACTION_KIND
USING tx_kind::text::TRANSACTION_KIND;

-- Step 4: Drop the old enum type
DROP TYPE TRANSACTION_KIND_OLD;
13 changes: 13 additions & 0 deletions orm/migrations/2024-12-10-110059_validator_states/down.sql
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
-- This file should undo anything in `up.sql`

-- Step 1: Rename the existing enum type
ALTER TYPE VALIDATOR_STATE RENAME TO VALIDATOR_STATE_OLD;

-- Step 2: Create the new enum type without the added values
CREATE TYPE VALIDATOR_STATE AS ENUM ('consensus', 'inactive', 'jailed', 'below_capacity', 'below_threshold', 'unknown');

-- Step 3: Update all columns to use the new enum type
ALTER TABLE validators ALTER COLUMN state TYPE VALIDATOR_STATE
USING state::text::VALIDATOR_STATE;

-- Step 4: Drop the old enum type
DROP TYPE VALIDATOR_STATE_OLD;
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
-- This file should undo anything in `up.sql`
DROP TABLE transaction_history;
DROP TABLE transaction_history;

DROP TYPE IF EXISTS HISTORY_KIND;
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ CREATE TABLE transaction_history (
);

CREATE UNIQUE INDEX index_transaction_history_target_inner_tx_id ON transaction_history(inner_tx_id, target, kind);
CREATE INDEX index_transaction_history_target ON transaction_history (target);
CREATE INDEX index_transaction_history_target ON transaction_history (target);
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- This file should undo anything in `up.sql`

UPDATE gas SET gas_limit = 50_000 WHERE tx_kind = 'shielded_transfer';
UPDATE gas SET gas_limit = 50_000 WHERE tx_kind = 'unshielding_transfer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Your SQL goes here

UPDATE gas SET gas_limit = 60_000 WHERE tx_kind = 'shielded_transfer';
UPDATE gas SET gas_limit = 60_000 WHERE tx_kind = 'unshielding_transfer';
2 changes: 2 additions & 0 deletions webserver/src/handler/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub async fn get_wrapper_tx(
State(state): State<CommonState>,
) -> Result<Json<Option<WrapperTransaction>>, ApiError> {
is_valid_hash(&tx_id)?;
let tx_id = tx_id.to_lowercase();

let wrapper_tx = state
.transaction_service
Expand Down Expand Up @@ -49,6 +50,7 @@ pub async fn get_inner_tx(
State(state): State<CommonState>,
) -> Result<Json<Option<InnerTransaction>>, ApiError> {
is_valid_hash(&tx_id)?;
let tx_id = tx_id.to_lowercase();

let inner_tx = state
.transaction_service
Expand Down
Loading