Skip to content

Conversation

lukegao209
Copy link
Contributor

encode and decode assetId format between hex and string by baid64

test : encode_decode_asset_id.rs

Copy link
Member

@zoedberg zoedberg left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! I've requested some changes, mainly stylistic. In addition please rebase the commits on the latest master, sign the commits with gpg, remove the merge commit and rename the last commit to add test for assetid(to|from)hexbytes APIs. Finally please remember to format and lint the code after making changes.

@lukegao209
Copy link
Contributor Author

@zoedberg all fixed

Copy link
Member

@zoedberg zoedberg left a comment

Choose a reason for hiding this comment

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

Thank you for addressing the requested changes!

Please see 2 small suggestions, other than that LGTM.

Please also squash the commits into a single one, signed with gpg and with add /assetid(to|from)hexbytes APIs as message. If you prefer keeping the commit adding the tests separated, then call the second commit add test for assetid(to|from)hexbytes APIs. Then rebase the commit (or the 2 commits) on the latest master commit (d13a4ec).

Finally, please before requesting the next review make sure the code is still linted and formatted (using rust 1.88.0).

#[error("Invalid asset ID: {0}")]
InvalidAssetID(String),

#[error("Invalid hex bytes")]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#[error("Invalid hex bytes")]
#[error("Invalid asset ID hex bytes")]

Comment on lines +144 to +163
#[derive(Deserialize, Serialize)]
pub(crate) struct AssetIdToHexBytesRequest {
pub(crate) asset_id: String,
}

#[derive(Deserialize, Serialize)]
pub(crate) struct AssetIdToHexBytesResponse {
pub(crate) hex_bytes: String,
}

#[derive(Deserialize, Serialize)]
pub(crate) struct AssetIdFromHexBytesRequest {
pub(crate) hex_bytes: String,
}

#[derive(Deserialize, Serialize)]
pub(crate) struct AssetIdFromHexBytesResponse {
pub(crate) asset_id: String,
}

Copy link
Member

Choose a reason for hiding this comment

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

please sort these alphabetically

@zoedberg zoedberg changed the title Feature encode decode asset add /assetid(to|from)hexbytes APIs Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants