Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cat-gateway): Fix endpoints cardano/assets and cardano/registrations/cip36 endpoints #1986

Open
wants to merge 97 commits into
base: main
Choose a base branch
from

Conversation

Mr-Leshiy
Copy link
Contributor

@Mr-Leshiy Mr-Leshiy commented Mar 9, 2025

Description

Copy link
Contributor

@bkioshn bkioshn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CIP36 implementation looks good, might need others to take a look at the assets part

@@ -1,9 +1,13 @@
SELECT problem_report,
SELECT nonce,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor issue about consistency: The file name is missing s or registration, should be get_invalid_registrations_w_stake_pk.cql so it is consistent with get_registrations_w_stake_pk

include_str!("../cql/get_registrations_w_stake_addr.cql");
/// Get registrations from stake public key query.
const GET_REGISTRATIONS_FROM_STAKE_PK_QUERY: &str =
include_str!("../cql/get_registrations_w_stake_pk.cql");

/// Get registration
#[derive(SerializeRow)]
pub(crate) struct GetRegistrationParams {
/// Stake address.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

Suggested change
/// Stake address.
/// Stake public key.


let mut invalid_registrations_iter = GetInvalidRegistrationQuery::execute(
/// Get registrations given a stake address, it can be time specific based on asat param,
/// or the latest registration returned if no asat given.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be all registration returned? Since it is doing <= slotno
Maybe can add "The first one is the latest one"

/// Production Stake Address Identifier
pub(crate) const STAKE_PROD: &str = "stake";
/// Test Stake Address Identifier
pub(crate) const STAKE_TEST: &str = "stake_test";
/// Bech32 Match Pattern
const BECH32: &str = "[a,c-h,j-n,p-z,0,2-9]";
/// Length of the encoded address (for type 0 - 3).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoiding confusion

/// Length of the encoded address that have 2 parts (for Shelley address type 0 - 3).
const ENCODED_TWO_PART_ADDR_LEN: usize = 98;
/// Length of the encoded address that have 1 part (for Shelley address type 6 - 7, and stake address).
const ENCODED_ONE_PART_ADDR_LEN: usize = 53;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review me PR is ready for review
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

3 participants