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: detailed response of parsing EIP4361 #627

Conversation

JeneaVranceanu
Copy link
Collaborator

@JeneaVranceanu JeneaVranceanu commented Sep 30, 2022

Enhanced EIP4361 feature: EIP4361.validate(...) returns validation object that holds:

  • isEIP4361 flag that tells if the message given for validation represents EIP4361;
  • isValid - tells if EIP4361 message is meeting all requirements;
  • optional EIP4361 that is safe to force unwrap if isValid equals true;
  • a dictionary of all successfully extracted (not parsed) fields with raw values for each field. Values are accessed by a new enum EIP4361Field.

This combination allows getting the reason for failed message parsing, e.g. if capturedFields does not contain value for EIP4361Field.address it's safe to assume that message does not contain the address field which is required.

Снимок экрана 2022-09-30 в 09 27 09

Снимок экрана 2022-09-29 в 22 12 31

@yaroslavyaroslav yaroslavyaroslav merged commit c55bb2b into web3swift-team:develop Sep 30, 2022
@JeneaVranceanu JeneaVranceanu deleted the fix/eip4361-invalid-fields branch October 1, 2022 09:15
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