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

'0x' strings returned by contract are incorrectly interpreted as nulls #4512

Closed
1 task done
Pzixel opened this issue Oct 29, 2021 · 1 comment · Fixed by #4730
Closed
1 task done

'0x' strings returned by contract are incorrectly interpreted as nulls #4512

Pzixel opened this issue Oct 29, 2021 · 1 comment · Fixed by #4730
Assignees
Labels
1.x 1.0 related issues Bug Addressing a bug

Comments

@Pzixel
Copy link

Pzixel commented Oct 29, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

'0x' strings returned by contract are incorrectly interpreted as nulls

Expected Behavior

They should be regular 2 chars length strings

Steps to Reproduce

Consider following contract function

function test() external view returns (string memory) {
    return '0x';
}

Now if we call it:

const myContract = await MyContract.new();
expect(await myContract.test()).to.be.equal('0x');

We will see AssertionError: expected null to equal '0x'

Web3.js Version

1.5.3

Environment

  • Operating System: Win10 x64
  • Browser: All
  • Node.js Version: v16.2.0
  • NPM Version: 7.23.0

Anything Else?

No response

@Pzixel Pzixel added the Bug Addressing a bug label Oct 29, 2021
@luu-alex
Copy link
Contributor

luu-alex commented Nov 5, 2021

Hey Pzixel, I'm currently taking a look. thank you for creating an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@nazarhussain @Pzixel @luu-alex @jdevcs @mconnelly8 and others