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: Update parse log #752

Merged
merged 2 commits into from
Jul 13, 2022
Merged

Conversation

classicalliu
Copy link
Contributor

No description provided.


let mut to_address = [0u8; 20];
to_address.copy_from_slice(&data[21..41]);
let to_address = match RegistryAddress::from_slice(&data[start..end]) {
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@jjyr jjyr requested a review from blckngm July 12, 2022 09:18
@jjyr jjyr merged commit 4b5e9ed into godwokenrises:develop Jul 13, 2022
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