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

Change IotaDocument::verify_document from a static function to a method #675

Merged
merged 3 commits into from
Feb 25, 2022

Conversation

cycraig
Copy link
Contributor

@cycraig cycraig commented Feb 25, 2022

Description of change

Changes the static associated function IotaDocument::verify_document(signed: &IotaDocument, signer: &IotaDocument) to be a method on IotaDocument, as suggested in #674. This change is to prevent confusion on the order of parameters in the function signature, as confusing signed with signer could lead to hard-to-detect bugs.

New signature: IotaDocument::verify_document(&self, signed: &IotaDocument)

This change also applies to WasmDocument.

This PR also changes the default build target for the bindings/wasm project to wasm32-unknown-unknown to ease local development friction when running cargo commands following the fixes in PR #666 (thanks @olivereanderson!).

Type of change

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Fix

How the change has been tested

Existing tests and examples which use verifyDocument explicitly and implicitly during DID Document resolution pass locally.

Change checklist

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@cycraig cycraig added Breaking change A change to the API that requires a major release. Part of "Changed" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog. Wasm Related to Wasm bindings. Becomes part of the Wasm changelog labels Feb 25, 2022
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for the changes and the wasm-target fix!

@cycraig cycraig merged commit 6c7d5a6 into dev Feb 25, 2022
@cycraig cycraig deleted the feat/verify-document branch February 25, 2022 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking change A change to the API that requires a major release. Part of "Changed" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog. Wasm Related to Wasm bindings. Becomes part of the Wasm changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants