-
Notifications
You must be signed in to change notification settings - Fork 14
Solana CCTP token pool extra-data improved ABI decoding #1099
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
Conversation
👋 toblich, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
@@ -14,6 +14,8 @@ impl TokenPoolExtraData { | |||
const NONCE_INDEXES: (usize, usize) = (24, 32); | |||
// The source domain is in bytes 60..64 in the serialized data (u32 is 4 bytes) | |||
const SOURCE_DOMAIN_INDEXES: (usize, usize) = (60, 64); | |||
// Total size of the serialized data (2 fields of 32 bytes each) | |||
const TOTAL_SIZE: usize = 64; | |||
|
|||
pub fn abi_encode(&self) -> [u8; 64] { | |||
let mut bytes = [0u8; 64]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nit: This method could also use TOTAL_SIZE instead of the 64 magic number, if nothing else to signal that they're the same constant (ditto return value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one minor comment.
|
No description provided.