-
Notifications
You must be signed in to change notification settings - Fork 38
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: Update parse log #752
Conversation
crates/utils/src/script_log.rs
Outdated
|
||
let mut to_address = [0u8; 20]; | ||
to_address.copy_from_slice(&data[21..41]); | ||
let to_address = match RegistryAddress::from_slice(&data[start..end]) { |
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.
Use get(start..end)
to avoid panic?
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.
Updated
let mut from_address = [0u8; 20]; | ||
from_address.copy_from_slice(&data[1..21]); | ||
fn parse_sudt_log_data(data: &[u8]) -> Result<(RegistryAddress, RegistryAddress, U256)> { | ||
let mut start = 0; |
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.
check length of data to avoid panic.
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.
Updated
No description provided.