From 8c4cd2385235bd4ad1acdccaa570f7abbf7bba9c Mon Sep 17 00:00:00 2001 From: Apisit Ritreungroj Date: Wed, 23 Oct 2024 20:59:42 +0700 Subject: [PATCH 1/4] feat: initial updated version --- catalyst-gateway/bin/Cargo.toml | 2 +- catalyst-gateway/bin/src/db/index/block/certs.rs | 2 +- catalyst-gateway/bin/src/db/index/block/txi.rs | 2 +- catalyst-gateway/bin/src/db/index/block/txo/mod.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/catalyst-gateway/bin/Cargo.toml b/catalyst-gateway/bin/Cargo.toml index 3b0ea38e289b..0d8475c0c538 100644 --- a/catalyst-gateway/bin/Cargo.toml +++ b/catalyst-gateway/bin/Cargo.toml @@ -15,7 +15,7 @@ repository.workspace = true workspace = true [dependencies] -cardano-chain-follower = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "2024-10-15-01" } +cardano-chain-follower = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", rev = "bb3b10e175114f7171a974809bf60ab6d7bc0a93"} c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "v0.0.3" } pallas = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" } diff --git a/catalyst-gateway/bin/src/db/index/block/certs.rs b/catalyst-gateway/bin/src/db/index/block/certs.rs index 1a8ecbf570df..af5c9a2196b1 100644 --- a/catalyst-gateway/bin/src/db/index/block/certs.rs +++ b/catalyst-gateway/bin/src/db/index/block/certs.rs @@ -251,7 +251,7 @@ impl CertInsertQuery { /// Index the certificates in a transaction. pub(crate) fn index( - &mut self, txs: &pallas::ledger::traverse::MultiEraTx<'_>, slot_no: u64, txn: i16, + &mut self, txs: &pallas::ledger::traverse::MultiEraTxWithRawAuxiliary<'_>, slot_no: u64, txn: i16, block: &MultiEraBlock, ) { #[allow(clippy::match_same_arms)] diff --git a/catalyst-gateway/bin/src/db/index/block/txi.rs b/catalyst-gateway/bin/src/db/index/block/txi.rs index f8ff02da8af6..87f0b98a84f6 100644 --- a/catalyst-gateway/bin/src/db/index/block/txi.rs +++ b/catalyst-gateway/bin/src/db/index/block/txi.rs @@ -74,7 +74,7 @@ impl TxiInsertQuery { } /// Index the transaction Inputs. - pub(crate) fn index(&mut self, txs: &pallas_traverse::MultiEraTx<'_>, slot_no: u64) { + pub(crate) fn index(&mut self, txs: &pallas_traverse::MultiEraTxWithRawAuxiliary<'_>, slot_no: u64) { // Index the TXI's. for txi in txs.inputs() { let txn_hash = txi.hash().to_vec(); diff --git a/catalyst-gateway/bin/src/db/index/block/txo/mod.rs b/catalyst-gateway/bin/src/db/index/block/txo/mod.rs index 66bd950822ff..d58ddb2ea556 100644 --- a/catalyst-gateway/bin/src/db/index/block/txo/mod.rs +++ b/catalyst-gateway/bin/src/db/index/block/txo/mod.rs @@ -136,7 +136,7 @@ impl TxoInsertQuery { /// Index the transaction Inputs. pub(crate) fn index( - &mut self, txs: &pallas::ledger::traverse::MultiEraTx<'_>, slot_no: u64, txn_hash: &[u8], + &mut self, txs: &pallas::ledger::traverse::MultiEraTxWithRawAuxiliary<'_>, slot_no: u64, txn_hash: &[u8], txn: i16, ) { let txn_id = hex::encode_upper(txn_hash); From 52f3eef653d902769dab93ddb3eb666da1b0b6b6 Mon Sep 17 00:00:00 2001 From: Apisit Ritreungroj Date: Wed, 23 Oct 2024 21:05:22 +0700 Subject: [PATCH 2/4] chore: fmtfix --- catalyst-gateway/bin/src/db/index/block/certs.rs | 4 ++-- catalyst-gateway/bin/src/db/index/block/txi.rs | 4 +++- catalyst-gateway/bin/src/db/index/block/txo/mod.rs | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/catalyst-gateway/bin/src/db/index/block/certs.rs b/catalyst-gateway/bin/src/db/index/block/certs.rs index af5c9a2196b1..3229c05d834e 100644 --- a/catalyst-gateway/bin/src/db/index/block/certs.rs +++ b/catalyst-gateway/bin/src/db/index/block/certs.rs @@ -251,8 +251,8 @@ impl CertInsertQuery { /// Index the certificates in a transaction. pub(crate) fn index( - &mut self, txs: &pallas::ledger::traverse::MultiEraTxWithRawAuxiliary<'_>, slot_no: u64, txn: i16, - block: &MultiEraBlock, + &mut self, txs: &pallas::ledger::traverse::MultiEraTxWithRawAuxiliary<'_>, slot_no: u64, + txn: i16, block: &MultiEraBlock, ) { #[allow(clippy::match_same_arms)] txs.certs().iter().for_each(|cert| { diff --git a/catalyst-gateway/bin/src/db/index/block/txi.rs b/catalyst-gateway/bin/src/db/index/block/txi.rs index 87f0b98a84f6..394ebbb83458 100644 --- a/catalyst-gateway/bin/src/db/index/block/txi.rs +++ b/catalyst-gateway/bin/src/db/index/block/txi.rs @@ -74,7 +74,9 @@ impl TxiInsertQuery { } /// Index the transaction Inputs. - pub(crate) fn index(&mut self, txs: &pallas_traverse::MultiEraTxWithRawAuxiliary<'_>, slot_no: u64) { + pub(crate) fn index( + &mut self, txs: &pallas_traverse::MultiEraTxWithRawAuxiliary<'_>, slot_no: u64, + ) { // Index the TXI's. for txi in txs.inputs() { let txn_hash = txi.hash().to_vec(); diff --git a/catalyst-gateway/bin/src/db/index/block/txo/mod.rs b/catalyst-gateway/bin/src/db/index/block/txo/mod.rs index d58ddb2ea556..eb2b43eb4dba 100644 --- a/catalyst-gateway/bin/src/db/index/block/txo/mod.rs +++ b/catalyst-gateway/bin/src/db/index/block/txo/mod.rs @@ -136,8 +136,8 @@ impl TxoInsertQuery { /// Index the transaction Inputs. pub(crate) fn index( - &mut self, txs: &pallas::ledger::traverse::MultiEraTxWithRawAuxiliary<'_>, slot_no: u64, txn_hash: &[u8], - txn: i16, + &mut self, txs: &pallas::ledger::traverse::MultiEraTxWithRawAuxiliary<'_>, slot_no: u64, + txn_hash: &[u8], txn: i16, ) { let txn_id = hex::encode_upper(txn_hash); From 4fa26f3c6393829153005bb95cf774bb5992bfce Mon Sep 17 00:00:00 2001 From: Apisit Ritreungroj Date: Fri, 1 Nov 2024 17:50:35 +0700 Subject: [PATCH 3/4] chore: apply latest change --- catalyst-gateway/bin/Cargo.toml | 8 ++++---- catalyst-gateway/bin/src/cardano/util.rs | 2 +- catalyst-gateway/bin/src/db/index/block/certs.rs | 2 +- catalyst-gateway/bin/src/db/index/block/txo/mod.rs | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/catalyst-gateway/bin/Cargo.toml b/catalyst-gateway/bin/Cargo.toml index 0d8475c0c538..224705388d90 100644 --- a/catalyst-gateway/bin/Cargo.toml +++ b/catalyst-gateway/bin/Cargo.toml @@ -15,12 +15,12 @@ repository.workspace = true workspace = true [dependencies] -cardano-chain-follower = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", rev = "bb3b10e175114f7171a974809bf60ab6d7bc0a93"} +cardano-chain-follower = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", rev = "39f7de8527b8d34c6ca6c1fbf2b06644af885547"} c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "v0.0.3" } -pallas = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" } -pallas-traverse = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" } -#pallas-crypto = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" } +pallas = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "c66bb4f1bb38ace465f6d385c195f98f09043f48" } +pallas-traverse = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "c66bb4f1bb38ace465f6d385c195f98f09043f48" } +#pallas-crypto = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "c66bb4f1bb38ace465f6d385c195f98f09043f48" } clap = { version = "4.5.18", features = ["derive", "env"] } tracing = { version = "0.1.40", features = ["log"] } diff --git a/catalyst-gateway/bin/src/cardano/util.rs b/catalyst-gateway/bin/src/cardano/util.rs index 5383c3690076..8647198e78b4 100644 --- a/catalyst-gateway/bin/src/cardano/util.rs +++ b/catalyst-gateway/bin/src/cardano/util.rs @@ -104,7 +104,7 @@ pub fn extract_stake_credentials_from_certs( StakeCredential::AddrKeyhash(stake_credential) => { stake_credentials.push(hex::encode(stake_credential.as_slice())); }, - StakeCredential::Scripthash(_) => (), + StakeCredential::ScriptHash(_) => (), } }, _ => continue, diff --git a/catalyst-gateway/bin/src/db/index/block/certs.rs b/catalyst-gateway/bin/src/db/index/block/certs.rs index 3229c05d834e..dbbc9ea9f4e9 100644 --- a/catalyst-gateway/bin/src/db/index/block/certs.rs +++ b/catalyst-gateway/bin/src/db/index/block/certs.rs @@ -168,7 +168,7 @@ impl CertInsertQuery { // witnessed. (cred.to_vec(), addr.clone(), false) }, - pallas::ledger::primitives::conway::StakeCredential::Scripthash(script) => { + pallas::ledger::primitives::conway::StakeCredential::ScriptHash(script) => { (script.to_vec(), default_addr, true) }, }; diff --git a/catalyst-gateway/bin/src/db/index/block/txo/mod.rs b/catalyst-gateway/bin/src/db/index/block/txo/mod.rs index eb2b43eb4dba..eb3f5e27b50b 100644 --- a/catalyst-gateway/bin/src/db/index/block/txo/mod.rs +++ b/catalyst-gateway/bin/src/db/index/block/txo/mod.rs @@ -159,7 +159,7 @@ impl TxoInsertQuery { txn, txo_index, &address, - txo.lovelace_amount(), + txo.value().coin(), txn_hash, ); @@ -171,13 +171,13 @@ impl TxoInsertQuery { slot_no, txn, &address, - txo.lovelace_amount(), + txo.value().coin(), ); self.unstaked_txo.push(params); } - for asset in txo.non_ada_assets() { + for asset in txo.value().assets() { let policy_id = asset.policy().to_vec(); for policy_asset in asset.assets() { if policy_asset.is_output() { From 2c80912a06b7622ab764647b85655e464f8d4ec7 Mon Sep 17 00:00:00 2001 From: Apisit Ritreungroj Date: Mon, 11 Nov 2024 19:50:37 +0700 Subject: [PATCH 4/4] feat: latest version after ci fix --- catalyst-gateway/bin/Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/catalyst-gateway/bin/Cargo.toml b/catalyst-gateway/bin/Cargo.toml index 224705388d90..cac5c94ee2f8 100644 --- a/catalyst-gateway/bin/Cargo.toml +++ b/catalyst-gateway/bin/Cargo.toml @@ -15,12 +15,12 @@ repository.workspace = true workspace = true [dependencies] -cardano-chain-follower = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", rev = "39f7de8527b8d34c6ca6c1fbf2b06644af885547"} +cardano-chain-follower = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", rev = "de7fa876a738182e9db7ac710975bf853b78f554"} c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "v0.0.3" } -pallas = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "c66bb4f1bb38ace465f6d385c195f98f09043f48" } -pallas-traverse = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "c66bb4f1bb38ace465f6d385c195f98f09043f48" } -#pallas-crypto = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "c66bb4f1bb38ace465f6d385c195f98f09043f48" } +pallas = { version = "0.31.0", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "51c0aa752926ecebafbf7b4ba90f62f835b78805" } +pallas-traverse = { version = "0.31.0", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "51c0aa752926ecebafbf7b4ba90f62f835b78805" } +#pallas-crypto = { version = "0.31.0", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "51c0aa752926ecebafbf7b4ba90f62f835b78805" } clap = { version = "4.5.18", features = ["derive", "env"] } tracing = { version = "0.1.40", features = ["log"] }