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

#501 | Fix bytes input #504

Merged
merged 2 commits into from
Dec 14, 2023
Merged

#501 | Fix bytes input #504

merged 2 commits into from
Dec 14, 2023

Conversation

ezra-sg
Copy link
Contributor

@ezra-sg ezra-sg commented Dec 13, 2023

Fixes #501

Description

The bytes input is currently implemented incorrectly, expecting a value like '[ab, cd, ef]' when it should be expecting a string like '0xabcdef' for bytes arrays. This PR fixes that issue.

Test scenarios

  • go to https://deploy-preview-504--dev-mainnet-teloscan.netlify.app/address/0x46893403C4aD778d7FDA0CdFCe355a0A7dba3333#contract
  • go to the Write tab
  • scroll down and expand the method estimateSendFee
  • enter the following values:
    _dstChainId: 102    
    _toAddress: 0x0000000000000000000000000000000000000000000000000000000000000001
    _amount: 1
    _useZro: false
    _adapterParams: 0x00010000000000000000000000000000000000000000000000000000000000030d40
    
    • you should be able to execute the method and get a result
  • in the _toAddress field, which is a fixed-length bytes input, enter a valid bytes string like 0xab
    • you should see an error saying the array must be 32 bytes long
  • type in a bytes string with an uneven number of byte characters, like 0xabc
    • you should see an error saying it must be even
  • type in any other invalid values
    • you should see an error
  • repeat the last 3 steps in the _adapterParams field
    • you should see the same results, except there should be no error saying it must be 32 bytes long

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have cleaned up the code in the areas my change touches
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings
  • I have removed any unnecessary console messages
  • I have included all english text to the translation file and/or created a new issue with the required translations for the currently supported languages
  • I have tested for mobile functionality and responsiveness
  • I have added appropriate test coverage

Copy link

netlify bot commented Dec 13, 2023

Deploy Preview for teloscan-stage ready!

Name Link
🔨 Latest commit a474828
🔍 Latest deploy log https://app.netlify.com/sites/teloscan-stage/deploys/657a3ff00fc8e4000857100f
😎 Deploy Preview https://deploy-preview-504--teloscan-stage.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 13, 2023

Deploy Preview for dev-mainnet-teloscan ready!

Name Link
🔨 Latest commit a474828
🔍 Latest deploy log https://app.netlify.com/sites/dev-mainnet-teloscan/deploys/657a3ff01bd09f00084bcd19
😎 Deploy Preview https://deploy-preview-504--dev-mainnet-teloscan.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ezra-sg ezra-sg marked this pull request as ready for review December 13, 2023 23:45
@ezra-sg ezra-sg marked this pull request as draft December 13, 2023 23:45
@ezra-sg ezra-sg marked this pull request as ready for review December 14, 2023 00:32
@donnyquixotic donnyquixotic merged commit 4122b99 into dev Dec 14, 2023
9 checks passed
@donnyquixotic donnyquixotic deleted the 501-bytes-input-fix branch December 14, 2023 02:06
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.

Bytes contract interface input
2 participants