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

Create client side tests for Hedera Account Service #4625

Closed
lukelee-sl opened this issue Jan 12, 2023 · 1 comment
Closed

Create client side tests for Hedera Account Service #4625

lukelee-sl opened this issue Jan 12, 2023 · 1 comment
Assignees

Comments

@lukelee-sl
Copy link
Member

Problem

Epic: #4619

Currently, there are no client tests for exercising and validating the functionality of the Hedera Account Service.

Solution

Create client side tests ensuring that the following scenarios are covered:

Positive Tests

  • Verify getVirtualAddresses returns the correct list of evmAddresses when an account holds 0, 1 and multiple virtual addresses.
  • Verify getHederaAddress returns the correct Hedera account Id given a virtual evmAddress.
  • Verify isVirtualAddress correctly returns true when a given evmAddress is a virtual address.
  • Verify isAuthorized correctly returns true when the signatureBlob has been validated to have been signed by a single key of a given address in the single key scenario.
  • Verify isAuthorized correctly returns true when the signatureBlob has been validated to have been signed by the multiple keys of a given address in multisig scenarios (e.g. 3 of 3 keys).
  • Verify isAuthorized correctly returns true when the signatureBlob has been validated to have been signed by the sufficient multiple keys of a given address in threshold keys scenarios (e.g. 2 of 3 keys).
  • Verify isAuthorizedRaw correctly returns true when the signatureBlob has been validated to have been signed by the evm key of a given address.

Negative Tests

  • Verify getVirtualAddresses returns an empty list of evmAddresses given an unknown Hedera account Id.
  • Verify getVirtualAddresses returns INVALID_ACCOUNT_ID given a special Hedera account Id (e.g. 0.0.800, 0.0.801).
  • Verify getHederaAddress returns INVALID_ACCOUNT_ID given a non-existing virtual evmAddress.
  • Verify getHederaAddress returns INVALID_ACCOUNT_ID given an evmAddress that is on the list of well known evm addresses.
  • Verify isVirtualAddress correctly returns false when a given evmAddress is not a virtual address.
  • Verify isAuthorized correctly returns false when the signatureBlob does not validate to have been signed by the key of a given address in the single key scenario. Also validate multikey/nested scenarios.
  • Verify isAuthorized correctly returns false when the signatureBlob does not validate to have been signed by the keys of a given address in the multisig scenarios.
  • Verify isAuthorized correctly returns false when the signatureBlob does not validate to have been signed by the sufficient keys of a given address in the threshold key scenario.
  • Verify isAuthorized returns error when passed signatureBlob in incorrect format (not encoded SignatureMap)
  • Verify isAuthorizedRaw correctly returns false when the signatureBlob does not validate to have been signed by the evm key of a given address.

Alternatives

No response

@david-bakin-sl
Copy link
Member

Closed in favor of smart contract repo's #844 (which is where the work will be done).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants