Skip to content

Commit

Permalink
fix purge queris
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy committed Jan 17, 2025
1 parent aee46d1 commit cf1f2a4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ WHERE stake_address = :stake_address
AND txn = :txn
AND txo = :txo
AND policy_id = :policy_id
AND policy_name = :policy_name
AND asset_name = :asset_name
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ DELETE FROM unstaked_txo_assets_by_txn_hash
WHERE txn_hash = :txn_hash
AND txo = :txo
AND policy_id = :policy_id
AND policy_name = :policy_name
AND asset_name = :asset_name
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ SELECT
txn,
txo,
policy_id,
policy_name
asset_name
FROM txo_assets_by_stake
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ SELECT
txn_hash,
txo,
policy_id,
policy_name
asset_name
FROM unstaked_txo_assets_by_txn_hash
9 changes: 4 additions & 5 deletions catalyst-gateway/bin/src/db/index/queries/purge/txo_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub(crate) mod result {
//! Return values for TXO Assets by Stake Address purge queries.
/// Primary Key Row
pub(crate) type PrimaryKey = (Vec<u8>, num_bigint::BigInt, i16, i16, Vec<u8>, String);
pub(crate) type PrimaryKey = (Vec<u8>, num_bigint::BigInt, i16, i16, Vec<u8>, Vec<u8>);
}

/// Select primary keys for TXO Assets by Stake Address.
Expand All @@ -42,8 +42,7 @@ pub(crate) struct Params {
/// Asset Policy Hash - Binary 28 bytes.
policy_id: Vec<u8>,
/// Name of the Policy (UTF8)
// TODO: https://github.com/input-output-hk/catalyst-voices/issues/1121
policy_name: String,
asset_name: Vec<u8>,
}

impl Debug for Params {
Expand All @@ -54,7 +53,7 @@ impl Debug for Params {
.field("txn", &self.txn)
.field("txo", &self.txo)
.field("policy_id", &self.policy_id)
.field("policy_name", &self.policy_name)
.field("asset_name", &self.asset_name)
.finish()
}
}
Expand All @@ -67,7 +66,7 @@ impl From<result::PrimaryKey> for Params {
txn: value.2,
txo: value.3,
policy_id: value.4,
policy_name: value.5,
asset_name: value.5,
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub(crate) mod result {
//! Return values for TXO Assets by TXN Hash purge queries.
/// Primary Key Row
pub(crate) type PrimaryKey = (Vec<u8>, num_bigint::BigInt, i16, i16, Vec<u8>, String);
pub(crate) type PrimaryKey = (Vec<u8>, num_bigint::BigInt, i16, i16, Vec<u8>, Vec<u8>);
}

/// Select primary keys for TXO Assets by TXN Hash.
Expand All @@ -42,8 +42,7 @@ pub(crate) struct Params {
/// Asset Policy Hash - Binary 28 bytes.
policy_id: Vec<u8>,
/// Name of the Policy (UTF8)
// TODO: https://github.com/input-output-hk/catalyst-voices/issues/1121
policy_name: String,
asset_name: Vec<u8>,
}

impl Debug for Params {
Expand All @@ -54,7 +53,7 @@ impl Debug for Params {
.field("txn", &self.txn)
.field("txo", &self.txo)
.field("policy_id", &self.policy_id)
.field("policy_name", &self.policy_name)
.field("asset_name", &self.asset_name)
.finish()
}
}
Expand All @@ -67,7 +66,7 @@ impl From<result::PrimaryKey> for Params {
txn: value.2,
txo: value.3,
policy_id: value.4,
policy_name: value.5,
asset_name: value.5,
}
}
}
Expand Down

0 comments on commit cf1f2a4

Please sign in to comment.