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

Check the validity of addresses in the SC statements #616 #843

Merged
merged 3 commits into from
Jan 30, 2023
Merged

Check the validity of addresses in the SC statements #616 #843

merged 3 commits into from
Jan 30, 2023

Conversation

apoorv-2204
Copy link
Contributor

@apoorv-2204 apoorv-2204 commented Jan 18, 2023

Description

  • We have to raise an error, whenever there is malformed address given to any function of smart contract.
  • The SC expects hex as binary, if binary not given it must be a string address.
  • In elixir true binary is represented by <<>> while string encoded binary with "data"

Algo

  • check if binary is true binary or string encoded binary
  • check if its a valid hexadecimal number
  • then convert to true binary
  • check whether true binary is valid ae protocol address

Fixes

Type of change

Please delete options that are not relevant.

  • Bug fix (SC accepts wrong address also)

How Has This Been Tested?

  • Units Tests
  • Mock test

Checklist:

  • My code follows the style guidelines of 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
  • My changes generate no new warnings
  • 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
  • Any dependent changes have been merged and published in downstream modules

@apoorv-2204 apoorv-2204 changed the title support for hash validate address Check_the_validity_of_addresses_in_the_SC_statements#616 Jan 18, 2023
@apoorv-2204 apoorv-2204 added smart contracts Involve smart contracts bug Something isn't working labels Jan 19, 2023
@apoorv-2204 apoorv-2204 changed the title Check_the_validity_of_addresses_in_the_SC_statements#616 Check the validity of addresses in the SC statements #616 Jan 19, 2023
@apoorv-2204 apoorv-2204 self-assigned this Jan 19, 2023
@apoorv-2204 apoorv-2204 marked this pull request as ready for review January 19, 2023 08:28
@Neylix Neylix merged commit ba126bc into archethic-foundation:develop Jan 30, 2023
@apoorv-2204 apoorv-2204 deleted the check_the_validity_of_addresses_in_the_SC_statements#616 branch February 6, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working smart contracts Involve smart contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants