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

feat: backend: generate_message warns if metadata seems useless #921

Merged
merged 2 commits into from
Jan 31, 2022

Conversation

Slesarew
Copy link
Contributor

Small but useful feature: warning if metadata could not really be used to parse signable transactions due to incomplete extensions set

@Slesarew Slesarew requested a review from prybalko January 28, 2022 20:29
/// signed extensions into Signer.
/// This function should be used for warnings only on generate_message side and during metadata
/// loading into Signer.
fn v14_warn (metadata_v14: &RuntimeMetadataV14) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the function name only, it's not obvious that it returns bool. Maybe is_v14_signed or is_v14_ok would be a better option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this below and also used hashmap to catch duplicates of extensions (paranoid but important!); please have another look

@Slesarew Slesarew requested a review from prybalko January 29, 2022 18:24
@Slesarew Slesarew merged commit 71cc544 into master Jan 31, 2022
@Slesarew Slesarew deleted the 2022-01-28-backend-warns-in-generate-message branch January 31, 2022 08:12
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.

2 participants